summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorShuah Khan <shuah.khan@hp.com>2013-02-20 18:24:34 +0100
committerJames Bottomley <JBottomley@Parallels.com>2013-02-24 10:33:27 +0100
commiteceaae187d3bd457b3dba29c4f23bccda374db63 (patch)
tree0be03c17478119101ddf736b0924ba1dfa919fc0 /drivers/scsi/hpsa.c
parent[SCSI] dc395x: uninitialized variable in device_alloc() (diff)
downloadlinux-eceaae187d3bd457b3dba29c4f23bccda374db63.tar.xz
linux-eceaae187d3bd457b3dba29c4f23bccda374db63.zip
[SCSI] hpsa: Check for dma_mapping_error in hpsa_map_one
Signed-off-by: Shuah Khan <shuah.khan@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 4f338061b5c3..3b4d195b4978 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1405,6 +1405,11 @@ static void hpsa_map_one(struct pci_dev *pdev,
}
addr64 = (u64) pci_map_single(pdev, buf, buflen, data_direction);
+ if (dma_mapping_error(&pdev->dev, addr64)) {
+ cp->Header.SGList = 0;
+ cp->Header.SGTotal = 0;
+ return;
+ }
cp->SG[0].Addr.lower =
(u32) (addr64 & (u64) 0x00000000FFFFFFFF);
cp->SG[0].Addr.upper =