提交 e6e1ad1e 编写于 作者: L Laurent Pinchart 提交者: Greg Kroah-Hartman

usb: gadget: uvc: configfs: Drop leaked references to config items

[ Upstream commit 86f3daed59bceb4fa7981d85e89f63ebbae1d561 ]

Some of the .allow_link() and .drop_link() operations implementations
call config_group_find_item() and then leak the reference to the
returned item. Fix this by dropping those references where needed.
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: NKieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 b7ffda42
......@@ -544,6 +544,7 @@ static int uvcg_control_class_allow_link(struct config_item *src,
unlock:
mutex_unlock(&opts->lock);
out:
config_item_put(header);
mutex_unlock(su_mutex);
return ret;
}
......@@ -579,6 +580,7 @@ static void uvcg_control_class_drop_link(struct config_item *src,
unlock:
mutex_unlock(&opts->lock);
out:
config_item_put(header);
mutex_unlock(su_mutex);
}
......@@ -2038,6 +2040,7 @@ static int uvcg_streaming_class_allow_link(struct config_item *src,
unlock:
mutex_unlock(&opts->lock);
out:
config_item_put(header);
mutex_unlock(su_mutex);
return ret;
}
......@@ -2078,6 +2081,7 @@ static void uvcg_streaming_class_drop_link(struct config_item *src,
unlock:
mutex_unlock(&opts->lock);
out:
config_item_put(header);
mutex_unlock(su_mutex);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册