]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - drivers/block/floppy.c
floppy: fix use-after-free in module load failure path
[~shefty/rdma-dev.git] / drivers / block / floppy.c
index 767107cce982bfdcb651797eb2fb634dde4f2356..8f19b380ca83a6aec417ab8eb8b8a2d50649ea8d 100644 (file)
@@ -4363,9 +4363,9 @@ out_unreg_blkdev:
 out_put_disk:
        while (dr--) {
                del_timer(&motor_off_timer[dr]);
-               put_disk(disks[dr]);
                if (disks[dr]->queue)
                        blk_cleanup_queue(disks[dr]->queue);
+               put_disk(disks[dr]);
        }
        return err;
 }