All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND,v6,1/2] usb/gadget/uvc-configfs Fix linked flag in a format not being set when format is linked into streaming header
@ 2018-06-08 18:44 Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2018-06-08 18:44 UTC (permalink / raw)
  To: Joel Pepper; +Cc: Felipe Balbi, linux-usb, Paul Elder

Hi Joel,

Thank you for the patch, and sorry for the late reply.

On Tuesday, 29 May 2018 22:02:12 EEST Joel Pepper wrote:
> While checks are in place to avoid attributes and children of a format
> being manipulated after the format is linked into the streaming header,
> the linked flag was never actually set, invalidating the protections.
> 
> Signed-off-by: Joel Pepper <joel.pepper@rwth-aachen.de>

This looks good to me, but you might want to shorten the subject line though, 
it's supposed to fit in 72 characters. How about

usb: gadget: uvc: configfs: Prevent format changes after linking header

Apart from that,


Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/usb/gadget/function/uvc_configfs.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/gadget/function/uvc_configfs.c
> b/drivers/usb/gadget/function/uvc_configfs.c index c9b8cc4a..7a98f9f 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -760,6 +760,7 @@ static int uvcg_streaming_header_allow_link(struct
> config_item *src, format_ptr->fmt = target_fmt;
>  	list_add_tail(&format_ptr->entry, &src_hdr->formats);
>  	++src_hdr->num_fmt;
> +	++target_fmt->linked;
> 
>  out:
>  	mutex_unlock(&opts->lock);
> @@ -797,6 +798,8 @@ static void uvcg_streaming_header_drop_link(struct
> config_item *src, break;
>  		}
> 
> +	--target_fmt->linked;
> +
>  out:
>  	mutex_unlock(&opts->lock);
>  	mutex_unlock(su_mutex);

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

* [RESEND,v6,1/2] usb/gadget/uvc-configfs Fix linked flag in a format not being set when format is linked into streaming header
@ 2018-05-29 19:02 Joel Pepper
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Pepper @ 2018-05-29 19:02 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Felipe Balbi, linux-usb, Paul Elder, Joel Pepper

While checks are in place to avoid attributes and children of a format
being manipulated after the format is linked into the streaming header,
the linked flag was never actually set, invalidating the protections.

Signed-off-by: Joel Pepper <joel.pepper@rwth-aachen.de>
---
 drivers/usb/gadget/function/uvc_configfs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c
index c9b8cc4a..7a98f9f 100644
--- a/drivers/usb/gadget/function/uvc_configfs.c
+++ b/drivers/usb/gadget/function/uvc_configfs.c
@@ -760,6 +760,7 @@ static int uvcg_streaming_header_allow_link(struct config_item *src,
 	format_ptr->fmt = target_fmt;
 	list_add_tail(&format_ptr->entry, &src_hdr->formats);
 	++src_hdr->num_fmt;
+	++target_fmt->linked;
 
 out:
 	mutex_unlock(&opts->lock);
@@ -797,6 +798,8 @@ static void uvcg_streaming_header_drop_link(struct config_item *src,
 			break;
 		}
 
+	--target_fmt->linked;
+
 out:
 	mutex_unlock(&opts->lock);
 	mutex_unlock(su_mutex);

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

end of thread, other threads:[~2018-06-08 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-08 18:44 [RESEND,v6,1/2] usb/gadget/uvc-configfs Fix linked flag in a format not being set when format is linked into streaming header Laurent Pinchart
  -- strict thread matches above, loose matches on Subject: below --
2018-05-29 19:02 Joel Pepper

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.