]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
libertas: add checks for the return value of sysfs_create_group
authorKangjie Lu <kjlu@umn.edu>
Tue, 8 Jan 2019 17:42:21 +0000 (11:42 -0600)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 1 Feb 2019 12:06:28 +0000 (14:06 +0200)
sysfs_create_group() could fail. The fix checkes its return values
and issue error messages if it fails.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/libertas/mesh.c

index b0cb16ef8d1d0a003ac19a1bacf774c09769ef98..2315fdff56c2f9e6466138544592ff6e1900d5cc 100644 (file)
@@ -797,7 +797,12 @@ static void lbs_persist_config_init(struct net_device *dev)
 {
        int ret;
        ret = sysfs_create_group(&(dev->dev.kobj), &boot_opts_group);
+       if (ret)
+               pr_err("failed to create boot_opts_group.\n");
+
        ret = sysfs_create_group(&(dev->dev.kobj), &mesh_ie_group);
+       if (ret)
+               pr_err("failed to create mesh_ie_group.\n");
 }
 
 static void lbs_persist_config_remove(struct net_device *dev)