All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Ricardo Ribalda <ribalda@chromium.org>,
	Tomasz Figa <tfiga@chromium.org>,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] media: uvcvideo: fix GFP_ flags in uvc_submit_urb()
Date: Fri, 19 Mar 2021 17:47:07 +0300	[thread overview]
Message-ID: <YFS5axzOQEJN6fHI@mwanda> (raw)

The uvc_submit_urb() function is supposed to use the passed in GFP_
flags but this code accidentally uses GFP_KERNEL instead.  Some of
the callers are passing GFP_ATOMIC so presumably this can lead to
sleeping in atomic context.

Fixes: b20f917f84e6 ("media: uvcvideo: Use dma_alloc_noncontiguous API")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/media/usb/uvc/uvc_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index cdd8eb500bb7..a777b389a66e 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1119,7 +1119,7 @@ static int uvc_submit_urb(struct uvc_urb *uvc_urb, gfp_t mem_flags)
 	dma_sync_sgtable_for_device(uvc_stream_to_dmadev(uvc_urb->stream),
 				    uvc_urb->sgt,
 				    uvc_stream_dir(uvc_urb->stream));
-	return usb_submit_urb(uvc_urb->urb, GFP_KERNEL);
+	return usb_submit_urb(uvc_urb->urb, mem_flags);
 }
 
 /*
-- 
2.30.2


             reply	other threads:[~2021-03-19 14:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 14:47 Dan Carpenter [this message]
2021-03-19 14:57 ` [PATCH] media: uvcvideo: fix GFP_ flags in uvc_submit_urb() Ricardo Ribalda Delgado
2021-03-19 15:07   ` Dan Carpenter

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=YFS5axzOQEJN6fHI@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.org \
    --cc=tfiga@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.