From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5DB5A40DFBE for ; Sat, 2 May 2026 02:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777689472; cv=none; b=F7YOMpj1nnXbpA26l+/eFSJInBbkDmhEMTrtRQcsHFWd4iJEnAXF3DUcb6FPz/xbZqmLIRsGCsO76/zTWp6ulf0FXEdAgiVmiolMid6zH9putyIvd8NvxdHGR3DyfkhyCuh48a8/4qh12kJGl2YUa/xIdH0i330RPjPxzgxeMDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777689472; c=relaxed/simple; bh=atoGxdPsFlWXGcFHo+pEw1E6jcec5yewRHJvdSydrSw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WI1ACu0zVnyEcINNaTPNMZ76d8sw1CarReHyKQ4b63hFCuaHxreNPC4qPx6dnAtOEQP/ul7GgkpSc/xWHVMNLaA1P10Yhf6fw38h9oiDnxGW8smFogrt/Yg9sDM8+m0JUZjjGARyk5RAGBEz+OBFtDdnxu191M45RiY/tLFMsho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g0DzKDym; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g0DzKDym" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DDE2C2BCB4; Sat, 2 May 2026 02:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777689472; bh=atoGxdPsFlWXGcFHo+pEw1E6jcec5yewRHJvdSydrSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g0DzKDymuqVktZ8mUKxIjIccNnZab2z8lmD5ClkVIqR4TlwlwUmR/D8Nh0cTISZG/ TO0/iVq/t5MBVRg27fv/uefemPPvT6uozpWTkinlNJaoM5QrVEYxIJ8fWd9WZfyKgl JXcJnMwVH9uzNJCew96+slqv7QecnLaEafYCE1g8KXO+d2rEFBFmBt0VLXlEWl/NIT g0fqP2qHrIgH4nDWx5G0HJJrMA8y9pXRE3YlpvLi0DUCNjXmiacj/hmaRhxA+gdQYt tJvAH8qM4Gn8KFH4x+zdQe1antisd3bxRS5+hCBVvtpIp8yiDhCR6OLdsWsiAnEDgS /ZQ21i5E2RgQw== From: Sasha Levin To: stable@vger.kernel.org Cc: Oliver Neukum , Sean Young , Hans Verkuil , Sasha Levin Subject: [PATCH 5.10.y] media: rc: igorplugusb: heed coherency rules Date: Fri, 1 May 2026 22:37:48 -0400 Message-ID: <20260502023748.96270-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026050129-pledge-library-93f6@gregkh> References: <2026050129-pledge-library-93f6@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Oliver Neukum [ Upstream commit eac69475b01fe1e861dfe3960b57fa95671c132e ] In a control request, the USB request structure can be subject to DMA on some HCs. Hence it must obey the rules for DMA coherency. Allocate it separately. Fixes: b1c97193c6437 ("[media] rc: port IgorPlug-USB to rc-core") Cc: stable@vger.kernel.org Signed-off-by: Oliver Neukum Signed-off-by: Sean Young Signed-off-by: Hans Verkuil [ replaced kzalloc_obj() with kzalloc(sizeof(*ir->request), GFP_KERNEL) ] Signed-off-by: Sasha Levin --- drivers/media/rc/igorplugusb.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/media/rc/igorplugusb.c b/drivers/media/rc/igorplugusb.c index 3e9988ee785f0..2ac19f283f4b9 100644 --- a/drivers/media/rc/igorplugusb.c +++ b/drivers/media/rc/igorplugusb.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,7 @@ struct igorplugusb { struct device *dev; struct urb *urb; - struct usb_ctrlrequest request; + struct usb_ctrlrequest *request; struct timer_list timer; @@ -123,7 +124,7 @@ static void igorplugusb_cmd(struct igorplugusb *ir, int cmd) { int ret; - ir->request.bRequest = cmd; + ir->request->bRequest = cmd; ir->urb->transfer_flags = 0; ret = usb_submit_urb(ir->urb, GFP_ATOMIC); if (ret) @@ -165,13 +166,17 @@ static int igorplugusb_probe(struct usb_interface *intf, if (!ir) return -ENOMEM; + ir->request = kzalloc(sizeof(*ir->request), GFP_KERNEL); + if (!ir->request) + goto fail; + ir->dev = &intf->dev; timer_setup(&ir->timer, igorplugusb_timer, 0); - ir->request.bRequest = GET_INFRACODE; - ir->request.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN; - ir->request.wLength = cpu_to_le16(sizeof(ir->buf_in)); + ir->request->bRequest = GET_INFRACODE; + ir->request->bRequestType = USB_TYPE_VENDOR | USB_DIR_IN; + ir->request->wLength = cpu_to_le16(sizeof(ir->buf_in)); ir->urb = usb_alloc_urb(0, GFP_KERNEL); if (!ir->urb) @@ -223,6 +228,7 @@ static int igorplugusb_probe(struct usb_interface *intf, rc_free_device(ir->rc); usb_free_urb(ir->urb); del_timer(&ir->timer); + kfree(ir->request); return ret; } @@ -236,6 +242,7 @@ static void igorplugusb_disconnect(struct usb_interface *intf) usb_set_intfdata(intf, NULL); usb_kill_urb(ir->urb); usb_free_urb(ir->urb); + kfree(ir->request); } static const struct usb_device_id igorplugusb_table[] = { -- 2.53.0