]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - block/bsg.c
[SCSI] bsg: fix oops on remove
[linux-2.6-omap-h63xx.git] / block / bsg.c
index f0b7cd3432160203ea6c650088ccfcd4acf2a3f6..54d617f7df3e03b3aa02def2473b03ad66a5d39b 100644 (file)
@@ -709,11 +709,12 @@ static void bsg_kref_release_function(struct kref *kref)
 {
        struct bsg_class_device *bcd =
                container_of(kref, struct bsg_class_device, ref);
+       struct device *parent = bcd->parent;
 
        if (bcd->release)
                bcd->release(bcd->parent);
 
-       put_device(bcd->parent);
+       put_device(parent);
 }
 
 static int bsg_put_device(struct bsg_device *bd)