mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-05-26 11:40:24 +02:00
media: rc: xbox_remote: heed DMA restrictions
The buffer for IO must not be part of the device structure
because that violates the DMA coherency rules.
Fixes: 02d32bdad3 ("media: rc: add driver for Xbox DVD Movie Playback Kit")
Cc: stable@vger.kernel.org
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
committed by
Hans Verkuil
parent
4284499266
commit
e280d1e5e3
@@ -55,7 +55,7 @@ struct xbox_remote {
|
||||
struct usb_interface *interface;
|
||||
|
||||
struct urb *irq_urb;
|
||||
unsigned char inbuf[DATA_BUFSIZE] __aligned(sizeof(u16));
|
||||
u8 *inbuf;
|
||||
|
||||
char rc_name[NAME_BUFSIZE];
|
||||
char rc_phys[NAME_BUFSIZE];
|
||||
@@ -218,6 +218,10 @@ static int xbox_remote_probe(struct usb_interface *interface,
|
||||
if (!xbox_remote || !rc_dev)
|
||||
goto exit_free_dev_rdev;
|
||||
|
||||
xbox_remote->inbuf = kzalloc(DATA_BUFSIZE, GFP_KERNEL);
|
||||
if (!xbox_remote->inbuf)
|
||||
goto exit_free_inbuf;
|
||||
|
||||
/* Allocate URB buffer */
|
||||
xbox_remote->irq_urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (!xbox_remote->irq_urb)
|
||||
@@ -262,6 +266,8 @@ exit_kill_urbs:
|
||||
usb_kill_urb(xbox_remote->irq_urb);
|
||||
exit_free_buffers:
|
||||
usb_free_urb(xbox_remote->irq_urb);
|
||||
exit_free_inbuf:
|
||||
kfree(xbox_remote->inbuf);
|
||||
exit_free_dev_rdev:
|
||||
rc_free_device(rc_dev);
|
||||
kfree(xbox_remote);
|
||||
@@ -287,6 +293,7 @@ static void xbox_remote_disconnect(struct usb_interface *interface)
|
||||
usb_kill_urb(xbox_remote->irq_urb);
|
||||
rc_free_device(xbox_remote->rdev);
|
||||
usb_free_urb(xbox_remote->irq_urb);
|
||||
kfree(xbox_remote->inbuf);
|
||||
kfree(xbox_remote);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user