diff options
author | Joel Pepper <joel.pepper@rwth-aachen.de> | 2018-05-29 21:02:12 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-09-24 18:01:56 +0200 |
commit | cb2200f7af8341aaf0c6abd7ba37e4c667c41639 (patch) | |
tree | 8cf834b65a27bc470b12496d0e23b9a41886a192 /drivers | |
parent | usb: gadget: uvc: configfs: Add bFrameIndex attributes (diff) | |
download | linux-cb2200f7af8341aaf0c6abd7ba37e4c667c41639.tar.xz linux-cb2200f7af8341aaf0c6abd7ba37e4c667c41639.zip |
usb: gadget: uvc: configfs: Prevent format changes after linking header
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.
Update the flag as appropriate in the header link calls.
Signed-off-by: Joel Pepper <joel.pepper@rwth-aachen.de>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/function/uvc_configfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c index b8763343dcae..799dc32c5bc7 100644 --- a/drivers/usb/gadget/function/uvc_configfs.c +++ b/drivers/usb/gadget/function/uvc_configfs.c @@ -928,6 +928,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); @@ -965,6 +966,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); |