Home Home > GIT Browse > SLE12-SP3
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kirjanov <dkirjanov@suse.com>2019-04-22 09:41:19 +0200
committerDenis Kirjanov <dkirjanov@suse.com>2019-04-22 09:41:19 +0200
commit0c22930a39e19515da3a789b304384c3f26f0d32 (patch)
tree71ad94b51b5f210da882510dd8b7e77327d9a1a8
parentd475a85f138fa88c200dc1dbe9d2b68ec38e2153 (diff)
net-sysfs: call dev_hold if kobject_init_and_add successSLE12-SP3
(git-fixes). suse-commit: 6b593d576f9f78ea60e968fde55be52aea4af072
-rw-r--r--net/core/net-sysfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 37488e5130fd..edafd949ec64 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -898,6 +898,8 @@ static int rx_queue_add_kobject(struct net_device *dev, int index)
if (error)
return error;
+ dev_hold(queue->dev);
+
if (dev->sysfs_rx_queue_group) {
error = sysfs_create_group(kobj, dev->sysfs_rx_queue_group);
if (error) {
@@ -907,7 +909,6 @@ static int rx_queue_add_kobject(struct net_device *dev, int index)
}
kobject_uevent(kobj, KOBJ_ADD);
- dev_hold(queue->dev);
return error;
}
@@ -1289,6 +1290,8 @@ static int netdev_queue_add_kobject(struct net_device *dev, int index)
if (error)
return error;
+ dev_hold(queue->dev);
+
#ifdef CONFIG_BQL
error = sysfs_create_group(kobj, &dql_group);
if (error) {
@@ -1298,7 +1301,6 @@ static int netdev_queue_add_kobject(struct net_device *dev, int index)
#endif
kobject_uevent(kobj, KOBJ_ADD);
- dev_hold(queue->dev);
return 0;
}