From: Oliver Neukum <oneukum@suse.com>
To: linux-media@vger.kernel.org, mchehab@kernel.org, sean@mess.org
Cc: Oliver Neukum <oneukum@suse.com>
Subject: [PATCH] imon_raw: respect DMA coherency
Date: Thu, 12 May 2022 15:03:21 +0200 [thread overview]
Message-ID: <20220512130321.30599-1-oneukum@suse.com> (raw)
No buffer can be embedded inside a descriptor, not even a simple be64.
Use a separate kmalloc()
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
drivers/media/rc/imon_raw.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/media/rc/imon_raw.c b/drivers/media/rc/imon_raw.c
index d41580f6e4c7..b7a0c0b34378 100644
--- a/drivers/media/rc/imon_raw.c
+++ b/drivers/media/rc/imon_raw.c
@@ -14,7 +14,7 @@ struct imon {
struct device *dev;
struct urb *ir_urb;
struct rc_dev *rcdev;
- __be64 ir_buf;
+ __be64 *ir_buf;
char phys[64];
};
@@ -137,10 +137,16 @@ static int imon_probe(struct usb_interface *intf,
if (!imon->ir_urb)
return -ENOMEM;
+ imon->ir_buf = kmalloc(sizeof(__be64), GFP_KERNEL);
+ if (!imon->ir_buf) {
+ ret = -ENOMEM;
+ goto free_urb;
+ }
+
imon->dev = &intf->dev;
usb_fill_int_urb(imon->ir_urb, udev,
usb_rcvintpipe(udev, ir_ep->bEndpointAddress),
- &imon->ir_buf, sizeof(imon->ir_buf),
+ imon->ir_buf, sizeof(__be64),
imon_ir_rx, imon, ir_ep->bInterval);
rcdev = devm_rc_allocate_device(&intf->dev, RC_DRIVER_IR_RAW);
@@ -177,6 +183,7 @@ static int imon_probe(struct usb_interface *intf,
free_urb:
usb_free_urb(imon->ir_urb);
+ kfree(imon->ir_buf);
return ret;
}
@@ -186,6 +193,7 @@ static void imon_disconnect(struct usb_interface *intf)
usb_kill_urb(imon->ir_urb);
usb_free_urb(imon->ir_urb);
+ kfree(imon->ir_buf);
}
static const struct usb_device_id imon_table[] = {
--
2.35.3
next reply other threads:[~2022-05-12 13:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 13:03 Oliver Neukum [this message]
2022-05-12 17:59 ` [PATCH] imon_raw: respect DMA coherency kernel test robot
2022-05-12 19:02 ` kernel test robot
2022-05-13 4:40 ` kernel test robot
2022-05-13 16:23 ` Sean Young
2022-05-16 11:00 ` Oliver Neukum
2022-05-16 16:40 ` Sean Young
2022-05-17 7:34 ` Oliver Neukum
2022-05-17 7:42 ` Sean Young
2022-05-17 8:28 ` Oliver Neukum
2022-05-17 10:45 ` Sean Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220512130321.30599-1-oneukum@suse.com \
--to=oneukum@suse.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sean@mess.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox