public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: 53c700: pass correct "dev" to dma_alloc_attrs()
@ 2019-01-24 10:33 Dan Carpenter
  2019-01-29  6:33 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-01-24 10:33 UTC (permalink / raw)
  To: kernel-janitors

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>
---
I just noticed this when I was reviewing some static checker stuff.  I
have not tested it.


 drivers/scsi/53c700.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index 128d658d472a..16957d7ac414 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -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");
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: 53c700: pass correct "dev" to dma_alloc_attrs()
  2019-01-24 10:33 [PATCH] scsi: 53c700: pass correct "dev" to dma_alloc_attrs() Dan Carpenter
@ 2019-01-29  6:33 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2019-01-29  6:33 UTC (permalink / raw)
  To: kernel-janitors


Dan,

> 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.

Applied to 5.0/scsi-fixes, thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-29  6:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-24 10:33 [PATCH] scsi: 53c700: pass correct "dev" to dma_alloc_attrs() Dan Carpenter
2019-01-29  6:33 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox