All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: uvcvideo: fix GFP_ flags in uvc_submit_urb()
@ 2021-03-19 14:47 Dan Carpenter
  2021-03-19 14:57 ` Ricardo Ribalda Delgado
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2021-03-19 14:47 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Ricardo Ribalda, Tomasz Figa, linux-media,
	kernel-janitors

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: uvcvideo: fix GFP_ flags in uvc_submit_urb()
  2021-03-19 14:47 [PATCH] media: uvcvideo: fix GFP_ flags in uvc_submit_urb() Dan Carpenter
@ 2021-03-19 14:57 ` Ricardo Ribalda Delgado
  2021-03-19 15:07   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Ribalda Delgado @ 2021-03-19 14:57 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, Ricardo Ribalda,
	Tomasz Figa, linux-media, kernel-janitors

Hi Dan

On Fri, Mar 19, 2021 at 3:48 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> 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>

I reported the same issue just some minutes ago. Christoph has already
fixed the patch in his tree.

Where did you get the patchset? from next? from linus? or directly
from Chirstoph tree?

Thanks!

> ---
>  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
>


-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: uvcvideo: fix GFP_ flags in uvc_submit_urb()
  2021-03-19 14:57 ` Ricardo Ribalda Delgado
@ 2021-03-19 15:07   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-03-19 15:07 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, Ricardo Ribalda,
	Tomasz Figa, linux-media, kernel-janitors

On Fri, Mar 19, 2021 at 03:57:44PM +0100, Ricardo Ribalda Delgado wrote:
> Hi Dan
> 
> On Fri, Mar 19, 2021 at 3:48 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >
> > 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>
> 
> I reported the same issue just some minutes ago. Christoph has already
> fixed the patch in his tree.
> 
> Where did you get the patchset? from next? from linus? or directly
> from Chirstoph tree?

From linux-next.  I'm not sure if it was from yesterday's linux-next or
from a couple days ago.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-19 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 14:47 [PATCH] media: uvcvideo: fix GFP_ flags in uvc_submit_urb() Dan Carpenter
2021-03-19 14:57 ` Ricardo Ribalda Delgado
2021-03-19 15:07   ` Dan Carpenter

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.