Skip to content

Commit f4da0de

Browse files
Desnes NunesHans Verkuil
authored andcommitted
media: uvcvideo: Avoid variable shadowing in uvc_ctrl_cleanup_fh
This avoids a variable loop shadowing occurring between the local loop iterating through the uvc_entity's controls and the global one going through the pending async controls of the file handle. Fixes: 10acb91 ("media: uvcvideo: Increase/decrease the PM counter per IOCTL") Cc: stable@vger.kernel.org Signed-off-by: Desnes Nunes <desnesn@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans de Goede <hansg@kernel.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
1 parent e67b5f8 commit f4da0de

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/media/usb/uvc/uvc_ctrl.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3307,7 +3307,6 @@ int uvc_ctrl_init_device(struct uvc_device *dev)
33073307
void uvc_ctrl_cleanup_fh(struct uvc_fh *handle)
33083308
{
33093309
struct uvc_entity *entity;
3310-
int i;
33113310

33123311
guard(mutex)(&handle->chain->ctrl_mutex);
33133312

@@ -3325,7 +3324,7 @@ void uvc_ctrl_cleanup_fh(struct uvc_fh *handle)
33253324
if (!WARN_ON(handle->pending_async_ctrls))
33263325
return;
33273326

3328-
for (i = 0; i < handle->pending_async_ctrls; i++)
3327+
for (unsigned int i = 0; i < handle->pending_async_ctrls; i++)
33293328
uvc_pm_put(handle->stream->dev);
33303329
}
33313330

0 commit comments

Comments
 (0)