[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2023091756-pastel-ipad-6cd7@gregkh>
Date: Sun, 17 Sep 2023 18:24:35 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Jonathan Bergh <bergh.jonathan@...il.com>
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: vme_user: Replace strcpy with strscpy
On Sun, Sep 17, 2023 at 05:43:02PM +0200, Jonathan Bergh wrote:
> Replace strcpy with strscpy as preferred by checkpatch in vme_fake.c to
> prevent warnings.
>
> Signed-off-by: Jonathan Bergh <bergh.jonathan@...il.com>
> ---
> drivers/staging/vme_user/vme_fake.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c
> index 9bcb89a84d53..0cf5700e151f 100644
> --- a/drivers/staging/vme_user/vme_fake.c
> +++ b/drivers/staging/vme_user/vme_fake.c
> @@ -1093,7 +1093,7 @@ static int __init fake_init(void)
> tasklet_init(&fake_device->int_tasklet, fake_VIRQ_tasklet,
> (unsigned long) fake_bridge);
>
> - strcpy(fake_bridge->name, driver_name);
> + strscpy(fake_bridge->name, driver_name, sizeof(fake_bridge->name));
If it were this easy, we would have swept the tree and done so, right?
Are you sure this is correct? If so, please document exactly why it is
correct in the changelog text when you resend this.
thanks,
greg k-h
Powered by blists - more mailing lists