X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fs390%2Fblock%2Fdasd_genhd.c;h=47ba4462708de9583cadef43f4cd0995567e7878;hb=49e1900d4cc2e7bcecb681fe60f0990bec2dcce8;hp=12c7d296eaa8a6bcbb9268d4b38494e1e5a68535;hpb=075395d228641646159dae3dd170fa3fc6ff477a;p=linux-2.6-omap-h63xx.git diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index 12c7d296eaa..47ba4462708 100644 --- a/drivers/s390/block/dasd_genhd.c +++ b/drivers/s390/block/dasd_genhd.c @@ -83,10 +83,12 @@ dasd_gendisk_alloc(struct dasd_device *device) void dasd_gendisk_free(struct dasd_device *device) { - del_gendisk(device->gdp); - device->gdp->queue = 0; - put_disk(device->gdp); - device->gdp = 0; + if (device->gdp) { + del_gendisk(device->gdp); + device->gdp->queue = NULL; + put_disk(device->gdp); + device->gdp = NULL; + } } /* @@ -136,7 +138,7 @@ dasd_destroy_partitions(struct dasd_device * device) * device->bdev to lower the offline open_count limit again. */ bdev = device->bdev; - device->bdev = 0; + device->bdev = NULL; /* * See fs/partition/check.c:delete_partition @@ -145,7 +147,7 @@ dasd_destroy_partitions(struct dasd_device * device) */ memset(&bpart, 0, sizeof(struct blkpg_partition)); memset(&barg, 0, sizeof(struct blkpg_ioctl_arg)); - barg.data = &bpart; + barg.data = (void __force __user *) &bpart; barg.op = BLKPG_DEL_PARTITION; for (bpart.pno = device->gdp->minors - 1; bpart.pno > 0; bpart.pno--) ioctl_by_bdev(bdev, BLKPG, (unsigned long) &barg);