Skip to content

Commit

Permalink
scsi: 53c700: pass correct "dev" to dma_alloc_attrs()
Browse files Browse the repository at this point in the history
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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Dan Carpenter authored and Martin K. Petersen committed Jan 29, 2019
1 parent b2d3492 commit 8437fcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/53c700.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ NCR_700_detect(struct scsi_host_template *tpnt,
if(tpnt->sdev_attrs == NULL)
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);
if(memory == NULL) {
printk(KERN_ERR "53c700: Failed to allocate memory for driver, detaching\n");
Expand Down

0 comments on commit 8437fcf

Please sign in to comment.