]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
s390/scm: reorder scm_remove
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Tue, 4 Sep 2012 17:37:51 +0000 (19:37 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 10 Sep 2012 07:54:31 +0000 (09:54 +0200)
Do not reset drvdata before the block device is cleaned up. With a
non-empty block queue drvdata could be accessed.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/scm_drv.c

index 349966f6fc529cf1ed695fed4abaf6f6465c2398..9fa0a908607b013ce3ef0981a323d3b4e9043bde 100644 (file)
@@ -52,8 +52,8 @@ static int scm_remove(struct scm_device *scmdev)
 {
        struct scm_blk_dev *bdev = dev_get_drvdata(&scmdev->dev);
 
-       dev_set_drvdata(&scmdev->dev, NULL);
        scm_blk_dev_cleanup(bdev);
+       dev_set_drvdata(&scmdev->dev, NULL);
        kfree(bdev);
 
        return 0;