From: =?utf-8?q?Kristian_H=C3=B8gsberg?= Subject: firewire: Return SCSI_MLQUEUE_HOST_BUSY for out of memory cases in queuecommand. Date: Wed, 9 May 2007 19:23:09 -0400 Signed-off-by: Kristian Hoegsberg Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: linux/drivers/firewire/fw-sbp2.c =================================================================== --- linux.orig/drivers/firewire/fw-sbp2.c +++ linux/drivers/firewire/fw-sbp2.c @@ -1017,7 +1017,9 @@ static int sbp2_scsi_queuecommand(struct */ 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 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)