diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-20 11:56:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-20 11:56:10 -0400 |
commit | 6c2445efb816a34dab7bb7357317e2d656f14cb1 (patch) | |
tree | b4ce999c18a27fab4c41e802abc39944727bd0e7 | |
parent | 929a8651f42544f2b94ec149dfb2901e0c0ee427 (diff) | |
parent | d3375ea7213d09284ee3683d8bc075b9d3786a03 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
cdrom: beyond ARRAY_SIZE of viocd_diskinfo
xen/blkfront: fix warning when deleting gendisk on unplug/shutdown
xen/blkfront: allow xenbus state transition to Closing->Closed when not Connected
-rw-r--r-- | drivers/block/xen-blkfront.c | 10 | ||||
-rw-r--r-- | drivers/cdrom/viocd.c | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 8f905089b72b..a6cbf7b808e6 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -934,8 +934,6 @@ static void blkfront_closing(struct xenbus_device *dev) | |||
934 | 934 | ||
935 | spin_lock_irqsave(&blkif_io_lock, flags); | 935 | spin_lock_irqsave(&blkif_io_lock, flags); |
936 | 936 | ||
937 | del_gendisk(info->gd); | ||
938 | |||
939 | /* No more blkif_request(). */ | 937 | /* No more blkif_request(). */ |
940 | blk_stop_queue(info->rq); | 938 | blk_stop_queue(info->rq); |
941 | 939 | ||
@@ -949,6 +947,8 @@ static void blkfront_closing(struct xenbus_device *dev) | |||
949 | blk_cleanup_queue(info->rq); | 947 | blk_cleanup_queue(info->rq); |
950 | info->rq = NULL; | 948 | info->rq = NULL; |
951 | 949 | ||
950 | del_gendisk(info->gd); | ||
951 | |||
952 | out: | 952 | out: |
953 | xenbus_frontend_closed(dev); | 953 | xenbus_frontend_closed(dev); |
954 | } | 954 | } |
@@ -977,8 +977,10 @@ static void backend_changed(struct xenbus_device *dev, | |||
977 | break; | 977 | break; |
978 | 978 | ||
979 | case XenbusStateClosing: | 979 | case XenbusStateClosing: |
980 | if (info->gd == NULL) | 980 | if (info->gd == NULL) { |
981 | xenbus_dev_fatal(dev, -ENODEV, "gd is NULL"); | 981 | xenbus_frontend_closed(dev); |
982 | break; | ||
983 | } | ||
982 | bd = bdget_disk(info->gd, 0); | 984 | bd = bdget_disk(info->gd, 0); |
983 | if (bd == NULL) | 985 | if (bd == NULL) |
984 | xenbus_dev_fatal(dev, -ENODEV, "bdget failed"); | 986 | xenbus_dev_fatal(dev, -ENODEV, "bdget failed"); |
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c index 13929356135c..9b1624e0ddeb 100644 --- a/drivers/cdrom/viocd.c +++ b/drivers/cdrom/viocd.c | |||
@@ -587,7 +587,7 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id) | |||
587 | struct device_node *node = vdev->dev.archdata.of_node; | 587 | struct device_node *node = vdev->dev.archdata.of_node; |
588 | 588 | ||
589 | deviceno = vdev->unit_address; | 589 | deviceno = vdev->unit_address; |
590 | if (deviceno > VIOCD_MAX_CD) | 590 | if (deviceno >= VIOCD_MAX_CD) |
591 | return -ENODEV; | 591 | return -ENODEV; |
592 | if (!node) | 592 | if (!node) |
593 | return -ENODEV; | 593 | return -ENODEV; |