Skip to content

Commit

Permalink
Revert "libertas: add checks for the return value of sysfs_create_group"
Browse files Browse the repository at this point in the history
[ Upstream commit 4665107 ]

This reverts commit 4342568.

Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.

Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted.  It will be fixed up "correctly" in a
later kernel change.

The original commit was incorrect, the error needs to be propagated back
to the caller AND if the second group call fails, the first needs to be
removed.  There are much better ways to solve this, the driver should
NOT be calling sysfs_create_group() on its own as it is racing userspace
and loosing.

Cc: Kangjie Lu <kjlu@umn.edu>
Cc: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210503115736.2104747-53-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
gregkh committed Jun 3, 2021
1 parent e04f1a7 commit bf2b6ff
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/net/wireless/marvell/libertas/mesh.c
Expand Up @@ -805,12 +805,7 @@ 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)
Expand Down

0 comments on commit bf2b6ff

Please sign in to comment.