summaryrefslogtreecommitdiff
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorBrian King <brking@us.ibm.com>2006-11-20 13:51:56 -0600
committerJeff Garzik <jeff@garzik.org>2006-11-28 03:51:55 -0500
commit08475a1920aa7acc535324d6991b830fa7625bd8 (patch)
tree12ec45ed05da376bac8205f31cb3c48fe35cd4aa /drivers/ata/libata-scsi.c
parentf33d625f40e3b803c4cdea3219abb96cabf5ea03 (diff)
downloadlinux-3.10-08475a1920aa7acc535324d6991b830fa7625bd8.tar.gz
linux-3.10-08475a1920aa7acc535324d6991b830fa7625bd8.tar.bz2
linux-3.10-08475a1920aa7acc535324d6991b830fa7625bd8.zip
[PATCH] libata: Fixup ata_sas_queuecmd to handle __ata_scsi_queuecmd failure
Fixes ata_sas_queuecmd to properly handle a failure from __ata_scsi_queuecmd. Signed-off-by: Brian King <brking@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 22643c0d9a5..47ea111d5ac 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3347,20 +3347,23 @@ EXPORT_SYMBOL_GPL(ata_sas_slave_configure);
* @ap: ATA port to which the command is being sent
*
* RETURNS:
- * Zero.
+ * Return value from __ata_scsi_queuecmd() if @cmd can be queued,
+ * 0 otherwise.
*/
int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *),
struct ata_port *ap)
{
+ int rc = 0;
+
ata_scsi_dump_cdb(ap, cmd);
if (likely(ata_scsi_dev_enabled(ap->device)))
- __ata_scsi_queuecmd(cmd, done, ap->device);
+ rc = __ata_scsi_queuecmd(cmd, done, ap->device);
else {
cmd->result = (DID_BAD_TARGET << 16);
done(cmd);
}
- return 0;
+ return rc;
}
EXPORT_SYMBOL_GPL(ata_sas_queuecmd);