# HG changeset patch # User Daniel Stodden # Date 1267197951 28800 # Node ID 3ea95de27eaed11b87a5c608629f5089b0b33a73 # Parent 6cee7e3206311d4556e5bb75ceb522e4e293d4d1 blktap: Fix tap kobj double unref in sysfs_destroy. It's that final put_device in device_unregister which is supposed to clear the caller's reference. Subtle indeed, because refcount went 2->3 when after sysfs_destroy: +1 for our own ring->dev +1 for the open sysfs ./remove attribute +1 for the callback scheduled Drops to 1 in device_unregister and 0 only after leaving callbacks. Signed-off-by: Daniel Stodden diff -r 6cee7e320631 -r 3ea95de27eae drivers/xen/blktap/sysfs.c --- a/drivers/xen/blktap/sysfs.c Fri Feb 26 07:25:50 2010 -0800 +++ b/drivers/xen/blktap/sysfs.c Fri Feb 26 07:25:51 2010 -0800 @@ -360,7 +360,6 @@ !atomic_read(&tap->ring.sysfs_refcnt))) return -EAGAIN; - put_device(dev); device_schedule_callback(dev, device_unregister); return 0;