]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
scsi: sr: Don't use GFP_DMA
authorChristoph Hellwig <hch@lst.de>
Wed, 22 Dec 2021 09:08:42 +0000 (10:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 08:04:30 +0000 (09:04 +0100)
[ Upstream commit d94d94969a4ba07a43d62429c60372320519c391 ]

The allocated buffers are used as a command payload, for which the block
layer and/or DMA API do the proper bounce buffering if needed.

Link: https://lore.kernel.org/r/20211222090842.920724-1-hch@lst.de
Reported-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/sr.c
drivers/scsi/sr_vendor.c

index 84dd776d36c3362709e47ad847df89989e00f436..fdbd5c691d333e4b2b4050136fe223f2e29d075f 100644 (file)
@@ -885,7 +885,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;
index b9db2ec6d03617e35a035518ff1de520af6fcc03..996bccadd3866b805cd4da1df0c6683d4be19827 100644 (file)
@@ -113,7 +113,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength)
        if (cd->vendor == VENDOR_TOSHIBA)
                density = (blocklength > 2048) ? 0x81 : 0x83;
 
-       buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
+       buffer = kmalloc(512, GFP_KERNEL);
        if (!buffer)
                return -ENOMEM;
 
@@ -161,7 +161,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
        if (cd->cdi.mask & CDC_MULTI_SESSION)
                return 0;
 
-       buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
+       buffer = kmalloc(512, GFP_KERNEL);
        if (!buffer)
                return -ENOMEM;