diff options
author | Dave Jones <davej@redhat.com> | 2012-03-22 12:05:20 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2012-03-22 12:05:20 -0400 |
commit | 7bd4dec4713c108dfe307272f1cfc22071d306a1 (patch) | |
tree | e15eef4a48831f55562f0d58a712782ccde1b6d9 /ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch | |
parent | 70f8133b7196205f2d5d745d69eb8e62027ff650 (diff) | |
download | kernel-7bd4dec4713c108dfe307272f1cfc22071d306a1.tar.gz kernel-7bd4dec4713c108dfe307272f1cfc22071d306a1.tar.xz kernel-7bd4dec4713c108dfe307272f1cfc22071d306a1.zip |
Linux v3.3-4074-g5375871
Diffstat (limited to 'ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch')
-rw-r--r-- | ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch b/ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch deleted file mode 100644 index 1768d5e6a..000000000 --- a/ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch +++ /dev/null @@ -1,48 +0,0 @@ -From dadfe1ad137e6fbe251b4a5dc310840cfe414db4 Mon Sep 17 00:00:00 2001 -From: Josh Boyer <jwboyer@redhat.com> -Date: Mon, 20 Feb 2012 15:28:39 -0500 -Subject: [PATCH] ums_realtek: do not use stack memory for DMA in - __do_config_autodelink - -__do_config_autodelink passes the data variable to the transport function. -If the calling functions pass a stack variable, this will eventually trigger -a DMA-API debug backtrace for mapping stack memory in the DMA buffer. Fix -this by calling kmemdup for the passed data instead. - -Signed-off-by: Josh Boyer <jwboyer@redhat.com> ---- - drivers/usb/storage/realtek_cr.c | 8 +++++++- - 1 files changed, 7 insertions(+), 1 deletions(-) - -diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c -index d32f720..eee2a96 100644 ---- a/drivers/usb/storage/realtek_cr.c -+++ b/drivers/usb/storage/realtek_cr.c -@@ -507,9 +507,14 @@ static int __do_config_autodelink(struct us_data *us, u8 *data, u16 len) - { - int retval; - u8 cmnd[12] = {0}; -+ u8 *buf; - - US_DEBUGP("%s, addr = 0xfe47, len = %d\n", __FUNCTION__, len); - -+ buf = kmemdup(data, len, GFP_NOIO); -+ if (!buf) -+ return USB_STOR_TRANSPORT_ERROR; -+ - cmnd[0] = 0xF0; - cmnd[1] = 0x0E; - cmnd[2] = 0xfe; -@@ -517,7 +522,8 @@ static int __do_config_autodelink(struct us_data *us, u8 *data, u16 len) - cmnd[4] = (u8)(len >> 8); - cmnd[5] = (u8)len; - -- retval = rts51x_bulk_transport_special(us, 0, cmnd, 12, data, len, DMA_TO_DEVICE, NULL); -+ retval = rts51x_bulk_transport_special(us, 0, cmnd, 12, buf, len, DMA_TO_DEVICE, NULL); -+ kfree(buf); - if (retval != USB_STOR_TRANSPORT_GOOD) { - return -EIO; - } --- -1.7.9 - |