diff options
author | Jody McIntyre <scjody@modernduck.com> | 2005-12-12 23:34:32 -0500 |
---|---|---|
committer | Jody McIntyre <scjody@modernduck.com> | 2005-12-12 23:34:32 -0500 |
commit | 525352eb6d355bef6adf597252fc6d04f2dbe66c (patch) | |
tree | 4d2b42372ec0ac985f2775b0ea260c707e93fdd4 /drivers/scsi/scsi_lib.c | |
parent | d51e86c18a479f1dbcef3aa20e58ad04d1233016 (diff) | |
parent | 0e670506668a43e1355b8f10c33d081a676bd521 (diff) | |
download | op-kernel-dev-525352eb6d355bef6adf597252fc6d04f2dbe66c.zip op-kernel-dev-525352eb6d355bef6adf597252fc6d04f2dbe66c.tar.gz |
Merge with http://kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 4afef5c..ce9d73a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -542,10 +542,17 @@ static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd) void scsi_next_command(struct scsi_cmnd *cmd) { - struct request_queue *q = cmd->device->request_queue; + struct scsi_device *sdev = cmd->device; + struct request_queue *q = sdev->request_queue; + + /* need to hold a reference on the device before we let go of the cmd */ + get_device(&sdev->sdev_gendev); scsi_put_command(cmd); scsi_run_queue(q); + + /* ok to remove device now */ + put_device(&sdev->sdev_gendev); } void scsi_run_host_queues(struct Scsi_Host *shost) |