[LTP] [PATCH 0/2] Fix proc parsing in newuname01

Andrea Cervesato andrea.cervesato@suse.com
Thu May 7 09:44:07 CEST 2026


Hi Cyril,

> Hi!
> > > +	f = fopen(path, "r");
> > > +	if (!f) {
> > > +		tst_brkm_(file, lineno, TBROK | TERRNO, NULL,
> > > +		          "Failed to open FILE '%s' for reading", path);
> > > +	}
> > > +
> > > +	if (!fgets(buf, buf_size, f))
> > 
> > Missing return; after tst_brkm_() — f is NULL if fopen failed, so fgets()
> > dereferences NULL. Every other error path in this file has return; after
> > tst_brkm_().
> 
> Yes I'm aware, thanks for reminding me though.
> 
> > > +	size_t len = strlen(buf);
> > 
> > Variable declaration after a statement. Move len to the top of the function
> > with FILE *f.
> 
> Do we stil follow the C89 in this regard? We already force gnu99 in
> the config.mk.

It doesn't make any sense indeed. I added the c99 agent rule, but we told
it to follow kernel linux conventions, which are specific, including this
one.

We can safely ignore and see if it happens again with other reviews, and
eventually update the configuration.

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list