sr: don't use GFP_DMA in get_capabilities
PATCH 1/1 sr: don't use GFP_DMA in get_capabilities
The allocated buffer is used as a command payload, for which the block layer and/or DMA API do the proper bounce buffering if needed.
Reported-by Baoquan He <[email protected]>
Signed-off-by Christoph Hellwig <[email protected]>
--- drivers/scsi/sr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/sr.c +1 -1
@@ -855,7 +855,7 @@ static void get_capabilities(struct scsi_cd *cd)/* allocate transfer buffer */ - buffer =kmalloc (512 ,GFP_KERNEL |GFP_DMA ); + buffer =kmalloc (512 ,GFP_KERNEL );if (!buffer) {sr_printk (KERN_ERR , cd,"out of memory.\n" );return ;
Signature · 1 line
2.30.2
Sorry, I'll replace this with a v2 also covering the callsites in sr_vendor.c.
Quoted 14 lines · Christoph Hellwig
The allocated buffer is used as a command payload, for which the block layer and/or DMA API do the proper bounce buffering if needed.
Reported-by Baoquan He <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>--- drivers/scsi/sr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/sr.c +0
-0
drivers/scsi/sr.c static void get_capabilities(struct scsi_cd *cd) · line 860
Quoted 7 lines
drivers/scsi/sr.c +1
-1@@ -855,7 +855,7 @@ static void get_capabilities(struct scsi_cd *cd)/* allocate transfer buffer */ - buffer =kmalloc (512 ,GFP_KERNEL |GFP_DMA ); + buffer =kmalloc (512 ,GFP_KERNEL );if (!buffer) {sr_printk (KERN_ERR , cd,"out of memory.\n" );
A separate trivial cleanup is the unnecessary memory allocation failure message here since the mm layer will already report such things.
-Tyrel
Quoted 2 lines
drivers/scsi/sr.c +0
-0return ;