[3.13.y.z extended stable] Patch "can: only rename enabled led triggers when changing the netdev name" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Tue Jun 17 21:42:41 UTC 2014


This is a note to let you know that I have just added a patch titled

    can: only rename enabled led triggers when changing the netdev name

to the linux-3.13.y-queue branch of the 3.13.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.13.y-queue

This patch is scheduled to be released in version 3.13.11.4.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From d1ed8e48976c84d35773dd69a2df969fc530f0c0 Mon Sep 17 00:00:00 2001
From: Oliver Hartkopp <socketcan at hartkopp.net>
Date: Tue, 27 May 2014 13:30:56 +0200
Subject: can: only rename enabled led triggers when changing the netdev name

commit 45fb4f8d81578e0a17c45c4593a3305afbf7a48b upstream.

Commit a1ef7bd9fce8 ("can: rename LED trigger name on netdev renames") renames
the led trigger names according to the changed netdevice name.

As not every CAN driver supports and initializes the led triggers, checking for
the CAN private datastructure with safe_candev_priv() in the notifier chain is
not enough.

This patch adds a check when CONFIG_CAN_LEDS is enabled and the driver does not
support led triggers.

For stable 3.9+

Cc: Fabio Baltieri <fabio.baltieri at gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan at hartkopp.net>
Acked-by: Kurt Van Dijck <dev.kurt at vandijck-laurijssen.be>
Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 drivers/net/can/led.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/can/led.c b/drivers/net/can/led.c
index a3d99a8..ab7f1b0 100644
--- a/drivers/net/can/led.c
+++ b/drivers/net/can/led.c
@@ -97,6 +97,9 @@ static int can_led_notifier(struct notifier_block *nb, unsigned long msg,
 	if (!priv)
 		return NOTIFY_DONE;

+	if (!priv->tx_led_trig || !priv->rx_led_trig)
+		return NOTIFY_DONE;
+
 	if (msg == NETDEV_CHANGENAME) {
 		snprintf(name, sizeof(name), "%s-tx", netdev->name);
 		led_trigger_rename_static(name, priv->tx_led_trig);
--
1.9.1





More information about the kernel-team mailing list