mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
usb: gadget: uvc: configfs: Drop leaked references to config items
[ Upstream commit 86f3daed59 ]
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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
699e597923
commit
013cf51fac
@@ -543,6 +543,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;
|
||||
}
|
||||
@@ -584,6 +585,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;
|
||||
}
|
||||
@@ -2047,6 +2049,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;
|
||||
}
|
||||
@@ -2091,6 +2094,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user