[PATCH] wireless: marvell: add checks for the return value of sysfs_create_group

Kangjie Lu kjlu at umn.edu
Tue Dec 25 19:43:03 PST 2018


sysfs_create_group() could fail, so let's check its return values and
issue error messages if it fails.

Signed-off-by: Kangjie Lu <kjlu at umn.edu>
---
 drivers/net/wireless/marvell/libertas/mesh.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c
index b0cb16ef8d1d..90b20618e0af 100644
--- a/drivers/net/wireless/marvell/libertas/mesh.c
+++ b/drivers/net/wireless/marvell/libertas/mesh.c
@@ -797,7 +797,11 @@ 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)
-- 
2.17.2 (Apple Git-113)




More information about the libertas-dev mailing list