IB/ipath: Fix crash on unload introduced by sysfs changes

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, January 25, 2008 - 7:16 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=657c2f...
Commit:     657c2f2cbccbac88689ac5174fc13dd3f9aece34
Parent:     b47711bfbcd4eb77ca61ef0162487b20e023ae55
Author:     Roland Dreier <rolandd@cisco.com>
AuthorDate: Fri Jan 25 14:15:21 2008 -0800
Committer:  Roland Dreier <rolandd@cisco.com>
CommitDate: Fri Jan 25 14:15:21 2008 -0800

    IB/ipath: Fix crash on unload introduced by sysfs changes
    
    Commit 23b9c1ab ("Infiniband: make ipath driver use default driver
    groups.") introduced a bug in the ipath driver where
    ipath_device_create_group() fell through into the error path, even on
    success, which meant that the sysfs groups it created would always get
    removed right away.  This made ipath_device_remove_group() hit the
    BUG_ON() in sysfs_remove_group() when it tried to remove those groups a
    second time.
    
    Correct the return path so that the groups stick around until they are
    supposed to be cleaned up.
    
    Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
 drivers/infiniband/hw/ipath/ipath_sysfs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_sysfs.c b/drivers/infiniband/hw/ipath/ipath_sysfs.c
index aa27ca9..e2a6534 100644
--- a/drivers/infiniband/hw/ipath/ipath_sysfs.c
+++ b/drivers/infiniband/hw/ipath/ipath_sysfs.c
@@ -770,7 +770,8 @@ int ipath_device_create_group(struct device *dev, struct ipath_devdata *dd)
 	if (ret)
 		goto bail_attrs;
 
-	sysfs_remove_group(&dev->kobj, &dev_counter_attr_group);
+	return 0;
+
 bail_attrs:
 	sysfs_remove_group(&dev->kobj, &dev_attr_group);
 bail:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
IB/ipath: Fix crash on unload introduced by sysfs changes, Linux Kernel Mailing List..., (Fri Jan 25, 7:16 pm)