Commit 187b2093 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Kleber Sacilotto de Souza

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

BugLink: https://bugs.launchpad.net/bugs/1853881

[ Upstream commit 86f3daed ]

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarKieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 8d1cd462
......@@ -564,6 +564,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;
}
......@@ -605,6 +606,7 @@ static int uvcg_control_class_drop_link(struct config_item *src,
unlock:
mutex_unlock(&opts->lock);
out:
config_item_put(header);
mutex_unlock(su_mutex);
return ret;
}
......@@ -2087,6 +2089,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;
}
......@@ -2131,6 +2134,7 @@ static int uvcg_streaming_class_drop_link(struct config_item *src,
unlock:
mutex_unlock(&opts->lock);
out:
config_item_put(header);
mutex_unlock(su_mutex);
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment