mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>, Baoquan He <bhe@redhat.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	jejb@linux.ibm.com, linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 15/16] scsi: sr: Don't use GFP_DMA
Date: Mon, 17 Jan 2022 12:06:37 -0500	[thread overview]
Message-ID: <20220117170638.1472900-15-sashal@kernel.org> (raw)
In-Reply-To: <20220117170638.1472900-1-sashal@kernel.org>

From: Christoph Hellwig <hch@lst.de>

[ 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        | 2 +-
 drivers/scsi/sr_vendor.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index be2daf5536ff7..180087d1c6cdb 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -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;
diff --git a/drivers/scsi/sr_vendor.c b/drivers/scsi/sr_vendor.c
index e3b0ce25162ba..2887be4316be9 100644
--- a/drivers/scsi/sr_vendor.c
+++ b/drivers/scsi/sr_vendor.c
@@ -119,7 +119,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength)
 		density = (blocklength > 2048) ? 0x81 : 0x83;
 #endif
 
-	buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
+	buffer = kmalloc(512, GFP_KERNEL);
 	if (!buffer)
 		return -ENOMEM;
 
@@ -167,7 +167,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;
 
-- 
2.34.1


  parent reply	other threads:[~2022-01-17 17:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 17:06 [PATCH AUTOSEL 4.14 01/16] clk: imx: Use div64_ul instead of do_div Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 02/16] powerpc/6xx: add missing of_node_put Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 03/16] powerpc/powernv: " Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 04/16] powerpc/cell: " Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 05/16] powerpc/btext: " Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 06/16] powerpc/watchdog: Fix missed watchdog reset due to memory ordering race Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 07/16] i2c: i801: Don't silently correct invalid transfer size Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 08/16] powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 09/16] i2c: mpc: Correct I2C reset procedure Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 10/16] w1: Misuse of get_user()/put_user() reported by sparse Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 11/16] ALSA: seq: Set upper limit of processed events Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 12/16] MIPS: OCTEON: add put_device() after of_find_device_by_node() Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 13/16] i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters Sasha Levin
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 14/16] MIPS: Octeon: Fix build errors using clang Sasha Levin
2022-01-17 17:06 ` Sasha Levin [this message]
2022-01-17 17:06 ` [PATCH AUTOSEL 4.14 16/16] ASoC: mediatek: mt8173: fix device_node leak Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220117170638.1472900-15-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=bhe@redhat.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome