From: Tyrel Datwyler <turtle.in.the.kernel@gmail.com>
To: Christoph Hellwig <hch@lst.de>, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, bhe@redhat.com
Subject: Re: [PATCH] sr: don't use GFP_DMA in get_capabilities
Date: Mon, 27 Dec 2021 16:34:06 -0800 [thread overview]
Message-ID: <9e512d2b-8467-9a6f-734c-eb6df37d5d69@gmail.com> (raw)
In-Reply-To: <20211222090159.916428-1-hch@lst.de>
On 12/22/21 1:01 AM, Christoph Hellwig wrote:
> 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 <bhe@redhat.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/scsi/sr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
> index 14c122839c409..f925b1f1f9ada 100644
> --- a/drivers/scsi/sr.c
> +++ b/drivers/scsi/sr.c
> @@ -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
> return;
>
prev parent reply other threads:[~2021-12-28 0:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-22 9:01 [PATCH] sr: don't use GFP_DMA in get_capabilities Christoph Hellwig
2021-12-22 9:06 ` Christoph Hellwig
2021-12-28 0:34 ` Tyrel Datwyler [this message]
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=9e512d2b-8467-9a6f-734c-eb6df37d5d69@gmail.com \
--to=turtle.in.the.kernel@gmail.com \
--cc=bhe@redhat.com \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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