libertas: add checks for the return value of sysfs_create_group

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>
This commit is contained in:
Kangjie Lu 2019-01-08 11:42:21 -06:00 committed by Kalle Valo
parent db040dfa53
commit 434256833d
1 changed files with 5 additions and 0 deletions

View File

@ -797,7 +797,12 @@ static void lbs_persist_config_init(struct net_device *dev)
{ {
int ret; int ret;
ret = sysfs_create_group(&(dev->dev.kobj), &boot_opts_group); 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); 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) static void lbs_persist_config_remove(struct net_device *dev)