Skip to content

Commit

Permalink
firewire: Return SCSI_MLQUEUE_HOST_BUSY for out of memory cases in qu…
Browse files Browse the repository at this point in the history
…euecommand.

Signed-off-by: Kristian Hoegsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
  • Loading branch information
Kristian Høgsberg authored and Stefan Richter committed May 10, 2007
1 parent 95ffc5e commit e1b68c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e1b68c4

Please sign in to comment.