Commit 84a78676 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

scsi: 53c700: pass correct "dev" to dma_alloc_attrs()

[ Upstream commit 8437fcf1 ]

The "hostdata->dev" pointer is NULL here.  We set "hostdata->dev = dev;"
later in the function and we also use "hostdata->dev" when we call
dma_free_attrs() in NCR_700_release().

This bug predates git version control.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6487e6b6
...@@ -295,7 +295,7 @@ NCR_700_detect(struct scsi_host_template *tpnt, ...@@ -295,7 +295,7 @@ NCR_700_detect(struct scsi_host_template *tpnt,
if(tpnt->sdev_attrs == NULL) if(tpnt->sdev_attrs == NULL)
tpnt->sdev_attrs = NCR_700_dev_attrs; tpnt->sdev_attrs = NCR_700_dev_attrs;
memory = dma_alloc_attrs(hostdata->dev, TOTAL_MEM_SIZE, &pScript, memory = dma_alloc_attrs(dev, TOTAL_MEM_SIZE, &pScript,
GFP_KERNEL, DMA_ATTR_NON_CONSISTENT); GFP_KERNEL, DMA_ATTR_NON_CONSISTENT);
if(memory == NULL) { if(memory == NULL) {
printk(KERN_ERR "53c700: Failed to allocate memory for driver, detaching\n"); printk(KERN_ERR "53c700: Failed to allocate memory for driver, detaching\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment