提交 d0361038 编写于 作者: J Joel Pepper 提交者: Greg Kroah-Hartman

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

[ Upstream commit cb2200f7af8341aaf0c6abd7ba37e4c667c41639 ]

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: NJoel Pepper <joel.pepper@rwth-aachen.de>
Reviewed-by: NKieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 e6e1ad1e
......@@ -766,6 +766,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);
......@@ -803,6 +804,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册