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

Cyril Hrubis chrubis@suse.cz
Thu May 7 09:37:13 CEST 2026


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's recomended to use this for various sysfs or procfs files that may be
> 
> s/recomended/recommended/
> 
> Regards,
> LTP AI Reviewer
> 
> --
> Andrea Cervesato
> SUSE QE Automation Engineer Linux
> andrea.cervesato@suse.com

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list