usb: gadget: uvc: configfs: Prevent format changes after linking header
PATCH v2 8/8 usb: gadget: uvc: configfs: Prevent format changes after linking header
Hi Kieran,
Quoted 10 lines · On Monday, 24 September 2018 15:50:45 EEST Kieran Bingham wrote:
Quoted 5 lines · Laurent Pinchart
From: Joel Pepper <[email protected]>
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.
That explains what's wrong, but not what we do about it. How about adding:
"Update the flag as appropriate in the header link calls."
Sounds good to me, I'll update that.
Quoted 3 lines
Quoted 1 line
Signed-off-by Joel Pepper <[email protected]>Missing and S-o-B from Laurent here? (I guess that will be added later?)
I haven't modified the patch, so haven't added my SoB to send it to the mailing list. I'll add it before issuing the pull request.
Quoted 37 lines
Otherwise,
Reviewed-by Kieran Bingham <[email protected]>Quoted 33 lines
---
drivers/usb/gadget/function/uvc_configfs.c | 3 +++ 1 file changed, 3 insertions(+)(quoted diff) +0
-0
b/drivers/usb/gadget/function/uvc_configfs.cindexb8763343dcae..799dc32c5bc7100644drivers/usb/gadget/function/uvc_configfs.c +0
-0@@ -928,6 +928,7 @@ static int uvcg_streaming_header_allow_link(struct
config_item*src,>drivers/usb/gadget/function/uvc_configfs.c +1
-0format_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);@@ -965,6 +966,8 @@ static void uvcg_streaming_header_drop_link(struct
config_item*src,>drivers/usb/gadget/function/uvc_configfs.c +2
-0break ; } + --target_fmt->linked; + out:mutex_unlock (&opts->lock);mutex_unlock (su_mutex);