[PATCH] PPC64 iSeries: fix viodasd remove

Stephen Rothwell sfr at canb.auug.org.au
Tue Nov 16 16:54:03 EST 2004


Hi Andrew,

This patch just makes sure that we do not dereference a viodasd gendisk
pointer after it has been freed.

Signed-off-by: Stephen Rothwell <sfr at canb.auug.org.au>
-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au

diff -ruNp linus-bk/drivers/block/viodasd.c linus-bk-viodasd.1/drivers/block/viodasd.c
--- linus-bk/drivers/block/viodasd.c	2004-06-30 15:40:03.000000000 +1000
+++ linus-bk-viodasd.1/drivers/block/viodasd.c	2004-11-16 16:36:00.000000000 +1100
@@ -764,8 +764,8 @@ static int viodasd_remove(struct vio_dev
 	d = &viodasd_devices[vdev->unit_address];
 	if (d->disk) {
 		del_gendisk(d->disk);
-		put_disk(d->disk);
 		blk_cleanup_queue(d->disk->queue);
+		put_disk(d->disk);
 		d->disk = NULL;
 	}
 	d->dev = NULL;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20041116/b396be9b/attachment.pgp 


More information about the Linuxppc64-dev mailing list