All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix a few LED naming related issues
@ 2015-03-26 23:42 Sakari Ailus
  2015-03-26 23:42 ` [PATCH 1/2] leds: Use log level warn instead of info when telling about a name clash Sakari Ailus
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sakari Ailus @ 2015-03-26 23:42 UTC (permalink / raw)
  To: ricardo.ribalda; +Cc: linux-leds, cooloney

Hi guys,

Just two more patches for LED naming --- change the log level from info to
warn, and fix a relatively minor-looking format string vulnerability.

-- 
Kind regards,
Sakari

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] leds: Use log level warn instead of info when telling about a name clash
  2015-03-26 23:42 [PATCH 0/2] Fix a few LED naming related issues Sakari Ailus
@ 2015-03-26 23:42 ` Sakari Ailus
  2015-03-26 23:42 ` [PATCH 2/2] leds: Don't treat the LED name as a format string Sakari Ailus
  2015-03-27  1:07 ` [PATCH 0/2] Fix a few LED naming related issues Bryan Wu
  2 siblings, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2015-03-26 23:42 UTC (permalink / raw)
  To: ricardo.ribalda; +Cc: linux-leds, cooloney

The LED names are expected to be unique in the system. Use KERN_WARNING log
level to notify the user about the matter.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/leds/led-class.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 4ca37b8..bbe0294 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -249,7 +249,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
 		return PTR_ERR(led_cdev->dev);
 
 	if (ret)
-		dev_info(parent, "Led %s renamed to %s due to name collision",
+		dev_warn(parent, "Led %s renamed to %s due to name collision",
 				led_cdev->name, dev_name(led_cdev->dev));
 
 #ifdef CONFIG_LEDS_TRIGGERS
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] leds: Don't treat the LED name as a format string
  2015-03-26 23:42 [PATCH 0/2] Fix a few LED naming related issues Sakari Ailus
  2015-03-26 23:42 ` [PATCH 1/2] leds: Use log level warn instead of info when telling about a name clash Sakari Ailus
@ 2015-03-26 23:42 ` Sakari Ailus
  2015-03-27  1:07 ` [PATCH 0/2] Fix a few LED naming related issues Bryan Wu
  2 siblings, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2015-03-26 23:42 UTC (permalink / raw)
  To: ricardo.ribalda; +Cc: linux-leds, cooloney

The LED name was wrongly interpreted as format string. Stop doing that.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/leds/led-class.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index bbe0294..ebf6dad4f 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -244,7 +244,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
 
 	ret = led_classdev_next_name(led_cdev->name, name, sizeof(name));
 	led_cdev->dev = device_create_with_groups(leds_class, parent, 0,
-					led_cdev, led_cdev->groups, name);
+				led_cdev, led_cdev->groups, "%s", name);
 	if (IS_ERR(led_cdev->dev))
 		return PTR_ERR(led_cdev->dev);
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Fix a few LED naming related issues
  2015-03-26 23:42 [PATCH 0/2] Fix a few LED naming related issues Sakari Ailus
  2015-03-26 23:42 ` [PATCH 1/2] leds: Use log level warn instead of info when telling about a name clash Sakari Ailus
  2015-03-26 23:42 ` [PATCH 2/2] leds: Don't treat the LED name as a format string Sakari Ailus
@ 2015-03-27  1:07 ` Bryan Wu
  2015-03-27 10:07   ` Sakari Ailus
  2 siblings, 1 reply; 5+ messages in thread
From: Bryan Wu @ 2015-03-27  1:07 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: Ricardo Ribalda Delgado, Linux LED Subsystem

On Thu, Mar 26, 2015 at 4:42 PM, Sakari Ailus <sakari.ailus@iki.fi> wrote:
> Hi guys,
>
> Just two more patches for LED naming --- change the log level from info to
> warn, and fix a relatively minor-looking format string vulnerability.
>

Looks good to me, I will merge them

-Bryan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Fix a few LED naming related issues
  2015-03-27  1:07 ` [PATCH 0/2] Fix a few LED naming related issues Bryan Wu
@ 2015-03-27 10:07   ` Sakari Ailus
  0 siblings, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2015-03-27 10:07 UTC (permalink / raw)
  To: Bryan Wu; +Cc: Ricardo Ribalda Delgado, Linux LED Subsystem

On Thu, Mar 26, 2015 at 06:07:44PM -0700, Bryan Wu wrote:
> On Thu, Mar 26, 2015 at 4:42 PM, Sakari Ailus <sakari.ailus@iki.fi> wrote:
> > Hi guys,
> >
> > Just two more patches for LED naming --- change the log level from info to
> > warn, and fix a relatively minor-looking format string vulnerability.
> >
> 
> Looks good to me, I will merge them

Oh, there's one thing I forgot. The patches are simple, but I haven't tested
them. I still need to find hardware I can use for testing which also has LED
devices.

Thanks.

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-27 10:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26 23:42 [PATCH 0/2] Fix a few LED naming related issues Sakari Ailus
2015-03-26 23:42 ` [PATCH 1/2] leds: Use log level warn instead of info when telling about a name clash Sakari Ailus
2015-03-26 23:42 ` [PATCH 2/2] leds: Don't treat the LED name as a format string Sakari Ailus
2015-03-27  1:07 ` [PATCH 0/2] Fix a few LED naming related issues Bryan Wu
2015-03-27 10:07   ` Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.