From nobody Wed Oct 8 05:55:35 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AA1B27FB3E for ; Tue, 1 Jul 2025 14:54:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751381680; cv=none; b=OqdMklLA6IpETnOP38DtCF0u4NJjokNHmI/FvPgn1Ko7QAPaxgReg5ycic+cOS/gur7MOpLaXqIqFmAuAFP7KMKEwSN4cro6Jr+Wz8jy/62eE3iH5cSkaVtuZli1djT96Lf10o0qeK2aWXBj6A39u0kDFW02koBqvqROeBcHfFk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751381680; c=relaxed/simple; bh=x6tJXHV4fk1EVQw4K1J3xGyEuEu2hZK7D0Ti0UAtj1Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JWD91CB1EID8T5mv2eUPFfMF/7h/Tr1eTbreKTmw7ZtNkzl3cJq3WUfPBeLbc3NJ+iEmfgt2ZRI81ddFle3UcjJhYROOnS+6Z1AkRbru29T7xjbLxA+rlH8BovhEPgQa0A6mF3qMNdPDR2rLRsf38Ynrhwh3d+czhzHrjxyyU3o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Z+zCQsVh; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Z+zCQsVh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751381677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=0zQvDsQLPoeUA3QBNmaBPCh3oUPwT2tmL8BD3RO1RuA=; b=Z+zCQsVhu4oQ0XI3aNnYKv4u73mfRbHu64LDCpvQrAc73hF3Im5gAdf6UH5b2/sRQbAPvX 3s6NGN9hCQKx67Njwrc5I77NSegO/58Sw8lcSZnEeuSWXTWUYQXsnfvShB9xaFK4OrxO8w U1NmiepA7+YVsvphhmSZgI1Q9NiXmqw= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-147-ORK0-R59OeWEBmJaOUU-sw-1; Tue, 01 Jul 2025 10:54:36 -0400 X-MC-Unique: ORK0-R59OeWEBmJaOUU-sw-1 X-Mimecast-MFC-AGG-ID: ORK0-R59OeWEBmJaOUU-sw_1751381675 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 76BD61955ECF; Tue, 1 Jul 2025 14:54:35 +0000 (UTC) Received: from desnesn-thinkpadp16vgen1.rmtbr.csb (unknown [10.96.134.31]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AAC6F30001B1; Tue, 1 Jul 2025 14:54:33 +0000 (UTC) From: Desnes Nunes To: laurent.pinchart@ideasonboard.com, hansg@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Desnes Nunes Subject: [PATCH] media: uvcvideo: avoid variable shadowing in uvc_ctrl_cleanup_fh Date: Tue, 1 Jul 2025 11:52:40 -0300 Message-ID: <20250701145240.105959-1-desnesn@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" 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: 10acb9101355 ("media: uvcvideo: Increase/decrease the PM counter per= IOCTL") Signed-off-by: Desnes Nunes Reviewed-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_c= trl.c index 44b6513c5264..91cc874da798 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -3260,7 +3260,6 @@ int uvc_ctrl_init_device(struct uvc_device *dev) void uvc_ctrl_cleanup_fh(struct uvc_fh *handle) { struct uvc_entity *entity; - int i; =20 guard(mutex)(&handle->chain->ctrl_mutex); =20 @@ -3278,7 +3277,7 @@ void uvc_ctrl_cleanup_fh(struct uvc_fh *handle) if (!WARN_ON(handle->pending_async_ctrls)) return; =20 - for (i =3D 0; i < handle->pending_async_ctrls; i++) + for (unsigned int j =3D 0; j < handle->pending_async_ctrls; j++) uvc_pm_put(handle->stream->dev); } =20 --=20 2.49.0