[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0e79e48c-f466-41f7-bb60-03f45f6b0628@kernel.org>
Date: Fri, 16 May 2025 06:45:04 +0200
From: Jiri Slaby <jirislaby@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org
Cc: kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v1 1/1] genirq: Bump the size of the local variable for
sprintf()
On 15. 05. 25, 10:55, Andy Shevchenko wrote:
> GCC is not happy about sprintf() call on a buffer that might be too small for
> the given formatting string.
>
> kernel/irq/debugfs.c:233:26: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
>
> Fix this by bumping the size of the local variable for sprintf().
>
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505151057.xbyXAbEn-lkp@intel.com/
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> kernel/irq/debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c
> index 3d6a5b3cfaf3..3527defd2890 100644
> --- a/kernel/irq/debugfs.c
> +++ b/kernel/irq/debugfs.c
> @@ -225,7 +225,7 @@ void irq_debugfs_copy_devname(int irq, struct device *dev)
>
> void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc)
> {
> - char name [10];
> + char name [12];
The max irq is ~ 512000, if I am counting correctly, so 7 B should be
actually enough for everybody ;).
But well, can we silence the warning in a better way? I doubt that...
>
> if (!irq_dir || !desc || desc->debugfs_file)
> return;
--
js
suse labs
Powered by blists - more mailing lists