From: Kristian Høgsberg Date: Wed, 9 May 2007 23:23:09 +0000 (-0400) Subject: firewire: Return SCSI_MLQUEUE_HOST_BUSY for out of memory cases in queuecommand. X-Git-Tag: v2.6.22-rc1~111^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1b68c4dcfb8bb7d79b6771e48767039ffbe00a8;p=linux-2.6 firewire: Return SCSI_MLQUEUE_HOST_BUSY for out of memory cases in queuecommand. Signed-off-by: Kristian Hoegsberg Signed-off-by: Stefan Richter --- diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index c32254e941..07be24e2d2 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c @@ -1017,7 +1017,9 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done) */ if (cmd->sc_data_direction == DMA_BIDIRECTIONAL) { fw_error("Cannot handle DMA_BIDIRECTIONAL - rejecting command"); - goto fail_alloc; + cmd->result = DID_ERROR << 16; + done(cmd); + return 0; } orb = kzalloc(sizeof *orb, GFP_ATOMIC); @@ -1093,9 +1095,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done) fail_mapping: kfree(orb); fail_alloc: - cmd->result = DID_ERROR << 16; - done(cmd); - return 0; + return SCSI_MLQUEUE_HOST_BUSY; } static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)