]> Pileus Git - ~andy/linux/blobdiff - block/bsg.c
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
[~andy/linux] / block / bsg.c
index 439940c3a1ff01c1d40e0f00a0baacc223cdc70a..93e757d7174b8b7a5ff6aeaee124915bfda5ccf7 100644 (file)
@@ -723,11 +723,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)