Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Browse files Browse the repository at this point in the history
* '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
  • Loading branch information
Linus Torvalds committed May 20, 2009
2 parents 929a865 + d3375ea commit 6c2445e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,6 @@ static void blkfront_closing(struct xenbus_device *dev)

spin_lock_irqsave(&blkif_io_lock, flags);

del_gendisk(info->gd);

/* No more blkif_request(). */
blk_stop_queue(info->rq);

Expand All @@ -949,6 +947,8 @@ static void blkfront_closing(struct xenbus_device *dev)
blk_cleanup_queue(info->rq);
info->rq = NULL;

del_gendisk(info->gd);

out:
xenbus_frontend_closed(dev);
}
Expand Down Expand Up @@ -977,8 +977,10 @@ static void backend_changed(struct xenbus_device *dev,
break;

case XenbusStateClosing:
if (info->gd == NULL)
xenbus_dev_fatal(dev, -ENODEV, "gd is NULL");
if (info->gd == NULL) {
xenbus_frontend_closed(dev);
break;
}
bd = bdget_disk(info->gd, 0);
if (bd == NULL)
xenbus_dev_fatal(dev, -ENODEV, "bdget failed");
Expand Down
2 changes: 1 addition & 1 deletion drivers/cdrom/viocd.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
struct device_node *node = vdev->dev.archdata.of_node;

deviceno = vdev->unit_address;
if (deviceno > VIOCD_MAX_CD)
if (deviceno >= VIOCD_MAX_CD)
return -ENODEV;
if (!node)
return -ENODEV;
Expand Down

0 comments on commit 6c2445e

Please sign in to comment.