lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z9KgxKocER3R1aPN@smile.fi.intel.com>
Date: Thu, 13 Mar 2025 11:09:24 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Zhihao Cheng <chengzhihao1@...wei.com>
Cc: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Miquel Raynal <miquel.raynal@...tlin.com>,
	Richard Weinberger <richard@....at>,
	Vignesh Raghavendra <vigneshr@...com>
Subject: Re: [PATCH v1 1/1] mtd: mtdpart: Do not supply NULL to printf()

On Thu, Mar 13, 2025 at 09:24:21AM +0800, Zhihao Cheng wrote:
> 在 2025/3/13 4:16, Andy Shevchenko 写道:
> > Compiler is not happy about NULL being supplied as printf() parameter:
> 
> printf -> printk? The title has the same issue.
> > 
> > drivers/mtd/mtdpart.c:693:34: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
> > 
> > Replace that with "(null)" to fix compilation error.

> Reviewed-by: Zhihao Cheng <chengzhihao1@...wei.com>

Thank you!

But I think my approach is a hack, the best is to move this message to the
after the follow up conditional and drop that ternary completely as we have
already another debug message before that. So, the parser == NULL can be
deducted from the appearance of the one and not the other one.

I'll send a v2.

> >   			if (!parser && !request_module("%s", *types))
> >   				parser = mtd_part_parser_get(*types);
> >   			pr_debug("%s: got parser %s\n", master->name,
> > -				parser ? parser->name : NULL);
> > +				parser ? parser->name : "(null)");
> >   			if (!parser)
> >   				continue;

(move it here)

> >   			ret = mtd_part_do_parse(parser, master, &pparts, data);

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ