Skip to content

Commit

Permalink
ieee1394: sbp2: fix bogus s/g access change
Browse files Browse the repository at this point in the history
sg_dma_len(sg) is invalid before the s/g list is DMA-mapped.

This fixes a post 2.6.24 regression which prevents access to SBP-2
devices on several architectures, introduced by "ieee1394: sbp2: s/g
list access cosmetics", commit 825f1df.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
  • Loading branch information
Stefan Richter committed Feb 2, 2008
1 parent 384170d commit 5fcf500
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/ieee1394/sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1465,10 +1465,9 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
orb->misc |= ORB_SET_DIRECTION(orb_direction);

/* special case if only one element (and less than 64KB in size) */
if ((scsi_use_sg == 1) &&
(sg_dma_len(sg) <= SBP2_MAX_SG_ELEMENT_LENGTH)) {
if (scsi_use_sg == 1 && sg->length <= SBP2_MAX_SG_ELEMENT_LENGTH) {

cmd->dma_size = sg_dma_len(sg);
cmd->dma_size = sg->length;
cmd->dma_type = CMD_DMA_PAGE;
cmd->cmd_dma = dma_map_page(hi->host->device.parent,
sg_page(sg), sg->offset,
Expand Down

0 comments on commit 5fcf500

Please sign in to comment.