Skip to contentSkip to conversation

Patch "net: dsa: check master device before put" has been added to the 4.13-stable tree

PATCH [email protected] 1 participant 1 message Nov 15, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net: dsa: check master device before put

to the 4.13-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-dsa-check-master-device-before-put.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Wed Nov 15 17:25:34 CET 2017

From: Vivien Didelot <[email protected]>
Date: Tue, 24 Oct 2017 16:37:19 -0400
Subject: net: dsa: check master device before put

From: Vivien Didelot <[email protected]>

[ Upstream commit 3eb8feeb1708c7dbfd2e97df92a2a407c116606e ]

In the case of pdata, the dsa_cpu_parse function calls dev_put() before making sure it isn't NULL. Fix this.

Fixes 71e0bbde0d88 ("net: dsa: Add support for platform data")
---
 net/dsa/dsa2.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/dsa/dsa2.c +4 -3
@@ -496,14 +496,15 @@ static int dsa_cpu_parse(struct dsa_port
 		if (!ethernet)
 			return -EINVAL;
 		ethernet_dev = of_find_net_device_by_node(ethernet);
+		if (!ethernet_dev)
+			return -EPROBE_DEFER;
 	} else {
 		ethernet_dev = dsa_dev_to_net_device(ds->cd->netdev[index]);
+		if (!ethernet_dev)
+			return -EPROBE_DEFER;
 		dev_put(ethernet_dev);
 	}
 
-	if (!ethernet_dev)
-		return -EPROBE_DEFER;
-
 	if (!dst->cpu_dp) {
 		dst->cpu_dp = port;
 		dst->cpu_dp->netdev = ethernet_dev;

Patches currently in stable-queue which might be from [email protected] are

queue-4.13/net-dsa-check-master-device-before-put.patch