2019-07-04 23:59:04

by Joe Perches

[permalink] [raw]
Subject: [PATCH 2/8] leds: as3645a: Fix misuse of strlcpy

Probable cut&paste typo - use the correct field size.

Signed-off-by: Joe Perches <[email protected]>
---
drivers/leds/leds-as3645a.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
index 14ab6b0e4de9..050088dff8dd 100644
--- a/drivers/leds/leds-as3645a.c
+++ b/drivers/leds/leds-as3645a.c
@@ -668,7 +668,7 @@ static int as3645a_v4l2_setup(struct as3645a *flash)
};

strlcpy(cfg.dev_name, led->name, sizeof(cfg.dev_name));
- strlcpy(cfgind.dev_name, flash->iled_cdev.name, sizeof(cfg.dev_name));
+ strlcpy(cfgind.dev_name, flash->iled_cdev.name, sizeof(cfgind.dev_name));

flash->vf = v4l2_flash_init(
&flash->client->dev, flash->flash_node, &flash->fled, NULL,
--
2.15.0


2019-07-05 07:35:30

by Sakari Ailus

[permalink] [raw]
Subject: Re: [PATCH 2/8] leds: as3645a: Fix misuse of strlcpy

On Thu, Jul 04, 2019 at 04:57:42PM -0700, Joe Perches wrote:
> Probable cut&paste typo - use the correct field size.
>
> Signed-off-by: Joe Perches <[email protected]>

Thanks, Joe!

Acked-by: Sakari Ailus <[email protected]>

> ---
> drivers/leds/leds-as3645a.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
> index 14ab6b0e4de9..050088dff8dd 100644
> --- a/drivers/leds/leds-as3645a.c
> +++ b/drivers/leds/leds-as3645a.c
> @@ -668,7 +668,7 @@ static int as3645a_v4l2_setup(struct as3645a *flash)
> };
>
> strlcpy(cfg.dev_name, led->name, sizeof(cfg.dev_name));
> - strlcpy(cfgind.dev_name, flash->iled_cdev.name, sizeof(cfg.dev_name));
> + strlcpy(cfgind.dev_name, flash->iled_cdev.name, sizeof(cfgind.dev_name));
>
> flash->vf = v4l2_flash_init(
> &flash->client->dev, flash->flash_node, &flash->fled, NULL,

--
Kind regards,

Sakari Ailus

2019-07-05 20:24:03

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 2/8] leds: as3645a: Fix misuse of strlcpy

On Thu 2019-07-04 16:57:42, Joe Perches wrote:
> Probable cut&paste typo - use the correct field size.
>
> Signed-off-by: Joe Perches <[email protected]>

Ack.
Pavel
> ---
> drivers/leds/leds-as3645a.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
> index 14ab6b0e4de9..050088dff8dd 100644
> --- a/drivers/leds/leds-as3645a.c
> +++ b/drivers/leds/leds-as3645a.c
> @@ -668,7 +668,7 @@ static int as3645a_v4l2_setup(struct as3645a *flash)
> };
>
> strlcpy(cfg.dev_name, led->name, sizeof(cfg.dev_name));
> - strlcpy(cfgind.dev_name, flash->iled_cdev.name, sizeof(cfg.dev_name));
> + strlcpy(cfgind.dev_name, flash->iled_cdev.name, sizeof(cfgind.dev_name));
>
> flash->vf = v4l2_flash_init(
> &flash->client->dev, flash->flash_node, &flash->fled, NULL,

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Attachments:
(No filename) (1.00 kB)
signature.asc (188.00 B)
Digital signature
Download all attachments

2019-07-15 18:31:17

by Jacek Anaszewski

[permalink] [raw]
Subject: Re: [PATCH 2/8] leds: as3645a: Fix misuse of strlcpy

Hi Joe,

Thank you for the patch.

On 7/5/19 1:57 AM, Joe Perches wrote:
> Probable cut&paste typo - use the correct field size.
>
> Signed-off-by: Joe Perches <[email protected]>
> ---
> drivers/leds/leds-as3645a.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
> index 14ab6b0e4de9..050088dff8dd 100644
> --- a/drivers/leds/leds-as3645a.c
> +++ b/drivers/leds/leds-as3645a.c
> @@ -668,7 +668,7 @@ static int as3645a_v4l2_setup(struct as3645a *flash)
> };
>
> strlcpy(cfg.dev_name, led->name, sizeof(cfg.dev_name));
> - strlcpy(cfgind.dev_name, flash->iled_cdev.name, sizeof(cfg.dev_name));
> + strlcpy(cfgind.dev_name, flash->iled_cdev.name, sizeof(cfgind.dev_name));
>
> flash->vf = v4l2_flash_init(
> &flash->client->dev, flash->flash_node, &flash->fled, NULL,
>

Applied to for-5.4 branch of linux-leds.git.

--
Best regards,
Jacek Anaszewski