[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [BLKTAP] fix sysfs cleanup on error case
# HG changeset patch # User Jake Wires <jwires@xxxxxxxxxxxxx> # Date 1172111891 28800 # Node ID f62a052384a54a379580a95aa79a70e3fcf86a6d # Parent eb190b1faa527370ac520f3611670664f54ef28d [BLKTAP] fix sysfs cleanup on error case Signed-off-by: Jake Wires <jwires@xxxxxxxxxxxxx> --- linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff -r eb190b1faa52 -r f62a052384a5 linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c --- a/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c Wed Feb 21 20:30:37 2007 +0000 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c Wed Feb 21 18:38:11 2007 -0800 @@ -47,6 +47,7 @@ struct backend_info blkif_t *blkif; struct xenbus_watch backend_watch; int xenbus_id; + int group_added; }; @@ -150,7 +151,12 @@ static struct attribute_group tapstat_gr int xentap_sysfs_addif(struct xenbus_device *dev) { - return sysfs_create_group(&dev->dev.kobj, &tapstat_group); + int err; + struct backend_info *be = dev->dev.driver_data; + err = sysfs_create_group(&dev->dev.kobj, &tapstat_group); + if (!err) + be->group_added = 1; + return err; } void xentap_sysfs_delif(struct xenbus_device *dev) @@ -174,7 +180,8 @@ static int blktap_remove(struct xenbus_d tap_blkif_free(be->blkif); be->blkif = NULL; } - xentap_sysfs_delif(be->dev); + if (be->group_added) + xentap_sysfs_delif(be->dev); kfree(be); dev->dev.driver_data = NULL; return 0; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |