From 0e6078b8150fc4eaa7d64518c306cfd7a3f40e62 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 26 Oct 2012 15:47:45 -0700 Subject: [PATCH] 3.4-stable patches added patches: drivers-hv-cleanup-error-handling-in-vmbus_open.patch ehci-add-yet-another-lucid-nohandoff-pci-quirk.patch ehci-fix-lucid-nohandoff-pci-quirk-to-be-more-generic-with-bios-versions.patch staging-android-binder-allow-using-highmem-for-binder-buffers.patch staging-android-binder-fix-memory-leak-on-thread-process-exit.patch usb-hub-send-clear_tt_buffer_complete-events-when-canceling-tt-clear-work.patch usb-opticon-fix-dma-from-stack.patch usb-opticon-fix-memory-leak-in-error-path.patch usb-storage-add-unusual_devs-entry-for-casio-ex-n1-digital-camera.patch usb-whiteheat-fix-memory-leak-in-error-path.patch --- ...cleanup-error-handling-in-vmbus_open.patch | 105 +++++++++++++ ...et-another-lucid-nohandoff-pci-quirk.patch | 34 +++++ ...o-be-more-generic-with-bios-versions.patch | 30 ++++ queue-3.4/series | 10 ++ ...low-using-highmem-for-binder-buffers.patch | 32 ++++ ...x-memory-leak-on-thread-process-exit.patch | 78 ++++++++++ ...-events-when-canceling-tt-clear-work.patch | 144 ++++++++++++++++++ .../usb-opticon-fix-dma-from-stack.patch | 44 ++++++ ...pticon-fix-memory-leak-in-error-path.patch | 38 +++++ ...entry-for-casio-ex-n1-digital-camera.patch | 39 +++++ ...teheat-fix-memory-leak-in-error-path.patch | 29 ++++ 11 files changed, 583 insertions(+) create mode 100644 queue-3.4/drivers-hv-cleanup-error-handling-in-vmbus_open.patch create mode 100644 queue-3.4/ehci-add-yet-another-lucid-nohandoff-pci-quirk.patch create mode 100644 queue-3.4/ehci-fix-lucid-nohandoff-pci-quirk-to-be-more-generic-with-bios-versions.patch create mode 100644 queue-3.4/staging-android-binder-allow-using-highmem-for-binder-buffers.patch create mode 100644 queue-3.4/staging-android-binder-fix-memory-leak-on-thread-process-exit.patch create mode 100644 queue-3.4/usb-hub-send-clear_tt_buffer_complete-events-when-canceling-tt-clear-work.patch create mode 100644 queue-3.4/usb-opticon-fix-dma-from-stack.patch create mode 100644 queue-3.4/usb-opticon-fix-memory-leak-in-error-path.patch create mode 100644 queue-3.4/usb-storage-add-unusual_devs-entry-for-casio-ex-n1-digital-camera.patch create mode 100644 queue-3.4/usb-whiteheat-fix-memory-leak-in-error-path.patch diff --git a/queue-3.4/drivers-hv-cleanup-error-handling-in-vmbus_open.patch b/queue-3.4/drivers-hv-cleanup-error-handling-in-vmbus_open.patch new file mode 100644 index 00000000000..2dd389cd04b --- /dev/null +++ b/queue-3.4/drivers-hv-cleanup-error-handling-in-vmbus_open.patch @@ -0,0 +1,105 @@ +From 1392550240aaa72ce3a094a38bd23525cd67ce60 Mon Sep 17 00:00:00 2001 +From: "K. Y. Srinivasan" +Date: Fri, 12 Oct 2012 13:22:42 -0700 +Subject: Drivers: hv: Cleanup error handling in vmbus_open() + +From: "K. Y. Srinivasan" + +commit 1392550240aaa72ce3a094a38bd23525cd67ce60 upstream. + +Fix a memory leak in the error handling path in the function vmbus_open(). + +Signed-off-by: K. Y. Srinivasan +Reviewed-by: Haiyang Zhang +Reported-by: Jason Wang +Acked-by: Jason Wang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hv/channel.c | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -146,14 +146,14 @@ int vmbus_open(struct vmbus_channel *new + + if (ret != 0) { + err = ret; +- goto errorout; ++ goto error0; + } + + ret = hv_ringbuffer_init( + &newchannel->inbound, in, recv_ringbuffer_size); + if (ret != 0) { + err = ret; +- goto errorout; ++ goto error0; + } + + +@@ -168,7 +168,7 @@ int vmbus_open(struct vmbus_channel *new + + if (ret != 0) { + err = ret; +- goto errorout; ++ goto error0; + } + + /* Create and init the channel open message */ +@@ -177,7 +177,7 @@ int vmbus_open(struct vmbus_channel *new + GFP_KERNEL); + if (!open_info) { + err = -ENOMEM; +- goto errorout; ++ goto error0; + } + + init_completion(&open_info->waitevent); +@@ -193,7 +193,7 @@ int vmbus_open(struct vmbus_channel *new + + if (userdatalen > MAX_USER_DEFINED_BYTES) { + err = -EINVAL; +- goto errorout; ++ goto error0; + } + + if (userdatalen) +@@ -208,19 +208,18 @@ int vmbus_open(struct vmbus_channel *new + sizeof(struct vmbus_channel_open_channel)); + + if (ret != 0) +- goto cleanup; ++ goto error1; + + t = wait_for_completion_timeout(&open_info->waitevent, 5*HZ); + if (t == 0) { + err = -ETIMEDOUT; +- goto errorout; ++ goto error1; + } + + + if (open_info->response.open_result.status) + err = open_info->response.open_result.status; + +-cleanup: + spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); + list_del(&open_info->msglistentry); + spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); +@@ -228,9 +227,12 @@ cleanup: + kfree(open_info); + return err; + +-errorout: +- hv_ringbuffer_cleanup(&newchannel->outbound); +- hv_ringbuffer_cleanup(&newchannel->inbound); ++error1: ++ spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); ++ list_del(&open_info->msglistentry); ++ spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); ++ ++error0: + free_pages((unsigned long)out, + get_order(send_ringbuffer_size + recv_ringbuffer_size)); + kfree(open_info); diff --git a/queue-3.4/ehci-add-yet-another-lucid-nohandoff-pci-quirk.patch b/queue-3.4/ehci-add-yet-another-lucid-nohandoff-pci-quirk.patch new file mode 100644 index 00000000000..bb595bbe2e1 --- /dev/null +++ b/queue-3.4/ehci-add-yet-another-lucid-nohandoff-pci-quirk.patch @@ -0,0 +1,34 @@ +From 8daf8b6086f9d575200cd0aa3797e26137255609 Mon Sep 17 00:00:00 2001 +From: Anisse Astier +Date: Tue, 9 Oct 2012 12:22:37 +0200 +Subject: ehci: Add yet-another Lucid nohandoff pci quirk + +From: Anisse Astier + +commit 8daf8b6086f9d575200cd0aa3797e26137255609 upstream. + +Board name changed on another shipping Lucid tablet. + +Signed-off-by: Anisse Astier +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/pci-quirks.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -548,6 +548,13 @@ static const struct dmi_system_id __devi + DMI_MATCH(DMI_BIOS_VERSION, "Lucid-"), + }, + }, ++ { ++ /* Pegatron Lucid (Ordissimo) */ ++ .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "Ordissimo"), ++ DMI_MATCH(DMI_BIOS_VERSION, "Lucid-"), ++ }, ++ }, + { } + }; + diff --git a/queue-3.4/ehci-fix-lucid-nohandoff-pci-quirk-to-be-more-generic-with-bios-versions.patch b/queue-3.4/ehci-fix-lucid-nohandoff-pci-quirk-to-be-more-generic-with-bios-versions.patch new file mode 100644 index 00000000000..20d968b99b7 --- /dev/null +++ b/queue-3.4/ehci-fix-lucid-nohandoff-pci-quirk-to-be-more-generic-with-bios-versions.patch @@ -0,0 +1,30 @@ +From c323dc023b9501e5d09582ec7efd1d40a9001d99 Mon Sep 17 00:00:00 2001 +From: Anisse Astier +Date: Tue, 9 Oct 2012 12:22:36 +0200 +Subject: ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS versions + +From: Anisse Astier + +commit c323dc023b9501e5d09582ec7efd1d40a9001d99 upstream. + +BIOS vendors keep changing the BIOS versions. Only match the beginning +of the string to match all Lucid tablets with board name M11JB. + +Signed-off-by: Anisse Astier +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/pci-quirks.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -545,7 +545,7 @@ static const struct dmi_system_id __devi + /* Pegatron Lucid (Ordissimo AIRIS) */ + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "M11JB"), +- DMI_MATCH(DMI_BIOS_VERSION, "Lucid-GE-133"), ++ DMI_MATCH(DMI_BIOS_VERSION, "Lucid-"), + }, + }, + { } diff --git a/queue-3.4/series b/queue-3.4/series index ed054d92b63..56616bd0dc7 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -14,3 +14,13 @@ revert-sunrpc-ensure-we-close-the-socket-on-epipe-errors-too.patch sunrpc-prevent-races-in-xs_abort_connection.patch xhci-fix-potential-null-ptr-deref-in-command-cancellation.patch sysfs-sysfs_pathname-sysfs_add_one-use-strlcat-instead-of-strcat.patch +staging-android-binder-fix-memory-leak-on-thread-process-exit.patch +staging-android-binder-allow-using-highmem-for-binder-buffers.patch +drivers-hv-cleanup-error-handling-in-vmbus_open.patch +ehci-fix-lucid-nohandoff-pci-quirk-to-be-more-generic-with-bios-versions.patch +ehci-add-yet-another-lucid-nohandoff-pci-quirk.patch +usb-storage-add-unusual_devs-entry-for-casio-ex-n1-digital-camera.patch +usb-hub-send-clear_tt_buffer_complete-events-when-canceling-tt-clear-work.patch +usb-whiteheat-fix-memory-leak-in-error-path.patch +usb-opticon-fix-dma-from-stack.patch +usb-opticon-fix-memory-leak-in-error-path.patch diff --git a/queue-3.4/staging-android-binder-allow-using-highmem-for-binder-buffers.patch b/queue-3.4/staging-android-binder-allow-using-highmem-for-binder-buffers.patch new file mode 100644 index 00000000000..cd7a14c1a5f --- /dev/null +++ b/queue-3.4/staging-android-binder-allow-using-highmem-for-binder-buffers.patch @@ -0,0 +1,32 @@ +From 585650dcec88e704a19bb226a34b6a7166111623 Mon Sep 17 00:00:00 2001 +From: Arve Hjønnevåg +Date: Tue, 16 Oct 2012 15:29:55 -0700 +Subject: Staging: android: binder: Allow using highmem for binder buffers + +From: Arve Hjønnevåg + +commit 585650dcec88e704a19bb226a34b6a7166111623 upstream. + +The default kernel mapping for the pages allocated for the binder +buffers is never used. Set the __GFP_HIGHMEM flag when allocating +these pages so we don't needlessly use low memory pages that may +be required elsewhere. + +Signed-off-by: Arve Hjønnevåg +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/android/binder.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/android/binder.c ++++ b/drivers/staging/android/binder.c +@@ -655,7 +655,7 @@ static int binder_update_page_range(stru + page = &proc->pages[(page_addr - proc->buffer) / PAGE_SIZE]; + + BUG_ON(*page); +- *page = alloc_page(GFP_KERNEL | __GFP_ZERO); ++ *page = alloc_page(GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO); + if (*page == NULL) { + printk(KERN_ERR "binder: %d: binder_alloc_buf failed " + "for page at %p\n", proc->pid, page_addr); diff --git a/queue-3.4/staging-android-binder-fix-memory-leak-on-thread-process-exit.patch b/queue-3.4/staging-android-binder-fix-memory-leak-on-thread-process-exit.patch new file mode 100644 index 00000000000..0ec0908057b --- /dev/null +++ b/queue-3.4/staging-android-binder-fix-memory-leak-on-thread-process-exit.patch @@ -0,0 +1,78 @@ +From 675d66b0ed5fd170d6a44cf8dbb3fa56a5347bdb Mon Sep 17 00:00:00 2001 +From: Arve Hjønnevåg +Date: Tue, 16 Oct 2012 15:29:54 -0700 +Subject: Staging: android: binder: Fix memory leak on thread/process exit + +From: Arve Hjønnevåg + +commit 675d66b0ed5fd170d6a44cf8dbb3fa56a5347bdb upstream. + +If a thread or process exited while a reply, one-way transaction or +death notification was pending, the struct holding the pending work +was leaked. + +Signed-off-by: Arve Hjønnevåg +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/android/binder.c | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +--- a/drivers/staging/android/binder.c ++++ b/drivers/staging/android/binder.c +@@ -2507,14 +2507,38 @@ static void binder_release_work(struct l + struct binder_transaction *t; + + t = container_of(w, struct binder_transaction, work); +- if (t->buffer->target_node && !(t->flags & TF_ONE_WAY)) ++ if (t->buffer->target_node && ++ !(t->flags & TF_ONE_WAY)) { + binder_send_failed_reply(t, BR_DEAD_REPLY); ++ } else { ++ binder_debug(BINDER_DEBUG_DEAD_TRANSACTION, ++ "binder: undelivered transaction %d\n", ++ t->debug_id); ++ t->buffer->transaction = NULL; ++ kfree(t); ++ binder_stats_deleted(BINDER_STAT_TRANSACTION); ++ } + } break; + case BINDER_WORK_TRANSACTION_COMPLETE: { ++ binder_debug(BINDER_DEBUG_DEAD_TRANSACTION, ++ "binder: undelivered TRANSACTION_COMPLETE\n"); + kfree(w); + binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE); + } break; ++ case BINDER_WORK_DEAD_BINDER_AND_CLEAR: ++ case BINDER_WORK_CLEAR_DEATH_NOTIFICATION: { ++ struct binder_ref_death *death; ++ ++ death = container_of(w, struct binder_ref_death, work); ++ binder_debug(BINDER_DEBUG_DEAD_TRANSACTION, ++ "binder: undelivered death notification, %p\n", ++ death->cookie); ++ kfree(death); ++ binder_stats_deleted(BINDER_STAT_DEATH); ++ } break; + default: ++ pr_err("binder: unexpected work type, %d, not freed\n", ++ w->type); + break; + } + } +@@ -2984,6 +3008,7 @@ static void binder_deferred_release(stru + nodes++; + rb_erase(&node->rb_node, &proc->nodes); + list_del_init(&node->work.entry); ++ binder_release_work(&node->async_todo); + if (hlist_empty(&node->refs)) { + kfree(node); + binder_stats_deleted(BINDER_STAT_NODE); +@@ -3022,6 +3047,7 @@ static void binder_deferred_release(stru + binder_delete_ref(ref); + } + binder_release_work(&proc->todo); ++ binder_release_work(&proc->delivered_death); + buffers = 0; + + while ((n = rb_first(&proc->allocated_buffers))) { diff --git a/queue-3.4/usb-hub-send-clear_tt_buffer_complete-events-when-canceling-tt-clear-work.patch b/queue-3.4/usb-hub-send-clear_tt_buffer_complete-events-when-canceling-tt-clear-work.patch new file mode 100644 index 00000000000..5294325013d --- /dev/null +++ b/queue-3.4/usb-hub-send-clear_tt_buffer_complete-events-when-canceling-tt-clear-work.patch @@ -0,0 +1,144 @@ +From 3b6054da68f9b0d5ed6a7ed0f42a79e61904352c Mon Sep 17 00:00:00 2001 +From: Octavian Purdila +Date: Mon, 1 Oct 2012 22:21:12 +0300 +Subject: usb hub: send clear_tt_buffer_complete events when canceling TT clear work + +From: Octavian Purdila + +commit 3b6054da68f9b0d5ed6a7ed0f42a79e61904352c upstream. + +There is a race condition in the USB hub code with regard to handling +TT clear requests that can get the HCD driver in a deadlock. Usually +when an TT clear request is scheduled it will be executed immediately: + +<7>[ 6.077583] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us] +<3>[ 6.078041] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82 +<7>[ 6.078299] hub_tt_work:731 +<7>[ 9.309089] usb 2-1.5: link qh1-0e01/f4d506c0 start 0 [1/2 us] +<7>[ 9.324526] ehci_hcd 0000:00:1d.0: reused qh f4d4db00 schedule +<7>[ 9.324539] usb 2-1.3: link qh1-0e01/f4d4db00 start 0 [1/2 us] +<7>[ 9.341530] usb 1-1.1: link qh4-0e01/f397aec0 start 2 [1/2 us] +<7>[ 10.116159] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us] +<3>[ 10.116459] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82 +<7>[ 10.116537] hub_tt_work:731 + +However, if a suspend operation is triggered before hub_tt_work is +scheduled, hub_quiesce will cancel the work without notifying the HCD +driver: + +<3>[ 35.033941] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d80 +<5>[ 35.034022] sd 0:0:0:0: [sda] Stopping disk +<7>[ 35.034039] hub 2-1:1.0: hub_suspend +<7>[ 35.034067] usb 2-1: unlink qh256-0001/f3b1ab00 start 1 [1/0 us] +<7>[ 35.035085] hub 1-0:1.0: hub_suspend +<7>[ 35.035102] usb usb1: bus suspend, wakeup 0 +<7>[ 35.035106] ehci_hcd 0000:00:1a.0: suspend root hub +<7>[ 35.035298] hub 2-0:1.0: hub_suspend +<7>[ 35.035313] usb usb2: bus suspend, wakeup 0 +<7>[ 35.035315] ehci_hcd 0000:00:1d.0: suspend root hub +<6>[ 35.250017] PM: suspend of devices complete after 216.979 msecs +<6>[ 35.250822] PM: late suspend of devices complete after 0.799 msecs +<7>[ 35.252343] ehci_hcd 0000:00:1d.0: wakeup: 1 +<7>[ 35.262923] ehci_hcd 0000:00:1d.0: --> PCI D3hot +<7>[ 35.263302] ehci_hcd 0000:00:1a.0: wakeup: 1 +<7>[ 35.273912] ehci_hcd 0000:00:1a.0: --> PCI D3hot +<6>[ 35.274254] PM: noirq suspend of devices complete after 23.442 msecs +<6>[ 35.274975] ACPI: Preparing to enter system sleep state S3 +<6>[ 35.292666] PM: Saving platform NVS memory +<7>[ 35.295030] Disabling non-boot CPUs ... +<6>[ 35.297351] CPU 1 is now offline +<6>[ 35.300345] CPU 2 is now offline +<6>[ 35.303929] CPU 3 is now offline +<7>[ 35.303931] lockdep: fixing up alternatives. +<6>[ 35.304825] Extended CMOS year: 2000 + +When the device will resume the EHCI driver will get stuck in +ehci_endpoint_disable waiting for the tt_clearing flag to reset: + +<0>[ 47.610967] usb 2-1.3: **** DPM device timeout **** +<7>[ 47.610972] f2f11c60 00000092 f2f11c0c c10624a5 00000003 f4c6e880 c1c8a4c0 c1c8a4c0 +<7>[ 47.610983] 15c55698 0000000b f56b34c0 f2a45b70 f4c6e880 00000082 f2a4602c f2f11c30 +<7>[ 47.610993] c10787f8 f4cac000 f2a45b70 00000000 f4cac010 f2f11c58 00000046 00000001 +<7>[ 47.611004] Call Trace: +<7>[ 47.611006] [] ? sched_clock_cpu+0xf5/0x160 +<7>[ 47.611019] [] ? lock_release_holdtime.part.22+0x88/0xf0 +<7>[ 47.611026] [] ? lock_timer_base.isra.35+0x26/0x50 +<7>[ 47.611034] [] ? schedule_timeout+0x133/0x290 +<7>[ 47.611044] [] schedule+0x1e/0x50 +<7>[ 47.611051] [] schedule_timeout+0x138/0x290 +<7>[ 47.611057] [] ? sched_clock_cpu+0xf5/0x160 +<7>[ 47.611063] [] ? usleep_range+0x40/0x40 +<7>[ 47.611070] [] schedule_timeout_uninterruptible+0x15/0x20 +<7>[ 47.611077] [] ehci_endpoint_disable+0x64/0x160 +<7>[ 47.611084] [] ? usb_hcd_flush_endpoint+0x10e/0x1d0 +<7>[ 47.611092] [] ? sysfs_add_file+0x13/0x20 +<7>[ 47.611100] [] usb_hcd_disable_endpoint+0x29/0x40 +<7>[ 47.611107] [] usb_disable_endpoint+0x5c/0x80 +<7>[ 47.611111] [] usb_disable_interface+0x37/0x50 +<7>[ 47.611116] [] usb_reset_and_verify_device+0x4b0/0x640 +<7>[ 47.611122] [] ? hub_port_status+0xb5/0x100 +<7>[ 47.611129] [] usb_port_resume+0xd5/0x220 +<7>[ 47.611136] [] generic_resume+0xf/0x30 +<7>[ 47.611142] [] usb_resume+0x133/0x180 +<7>[ 47.611147] [] ? usb_dev_thaw+0x10/0x10 +<7>[ 47.611152] [] usb_dev_resume+0xd/0x10 +<7>[ 47.611157] [] dpm_run_callback+0x40/0xb0 +<7>[ 47.611164] [] ? pm_runtime_enable+0x43/0x70 +<7>[ 47.611171] [] device_resume+0x1a6/0x2c0 +<7>[ 47.611177] [] ? dpm_show_time+0xe0/0xe0 +<7>[ 47.611183] [] async_resume+0x19/0x40 +<7>[ 47.611189] [] async_run_entry_fn+0x64/0x160 +<7>[ 47.611196] [] ? process_one_work+0x104/0x480 +<7>[ 47.611203] [] ? process_one_work+0x10c/0x480 +<7>[ 47.611209] [] process_one_work+0x180/0x480 +<7>[ 47.611215] [] ? process_one_work+0x104/0x480 +<7>[ 47.611220] [] ? async_schedule+0x10/0x10 +<7>[ 47.611226] [] worker_thread+0x11c/0x2f0 +<7>[ 47.611233] [] ? manage_workers.isra.27+0x1f0/0x1f0 +<7>[ 47.611239] [] kthread+0x78/0x80 +<7>[ 47.611244] [] ? timer_cpu_notify+0xd6/0x20d +<7>[ 47.611253] [] ? __init_kthread_worker+0x60/0x60 +<7>[ 47.611258] [] kernel_thread_helper+0x6/0xd +<7>[ 47.611283] ------------[ cut here ]------------ + +This patch changes hub_quiesce behavior to flush the TT clear work +instead of canceling it, to make sure that no TT clear request remains +uncompleted before suspend. + +Signed-off-by: Octavian Purdila +Acked-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/hub.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -507,13 +507,16 @@ static void hub_tt_work(struct work_stru + int limit = 100; + + spin_lock_irqsave (&hub->tt.lock, flags); +- while (--limit && !list_empty (&hub->tt.clear_list)) { ++ while (!list_empty(&hub->tt.clear_list)) { + struct list_head *next; + struct usb_tt_clear *clear; + struct usb_device *hdev = hub->hdev; + const struct hc_driver *drv; + int status; + ++ if (!hub->quiescing && --limit < 0) ++ break; ++ + next = hub->tt.clear_list.next; + clear = list_entry (next, struct usb_tt_clear, clear_list); + list_del (&clear->clear_list); +@@ -978,7 +981,7 @@ static void hub_quiesce(struct usb_hub * + if (hub->has_indicators) + cancel_delayed_work_sync(&hub->leds); + if (hub->tt.hub) +- cancel_work_sync(&hub->tt.clear_work); ++ flush_work_sync(&hub->tt.clear_work); + } + + /* caller has locked the hub device */ diff --git a/queue-3.4/usb-opticon-fix-dma-from-stack.patch b/queue-3.4/usb-opticon-fix-dma-from-stack.patch new file mode 100644 index 00000000000..9c31a25a716 --- /dev/null +++ b/queue-3.4/usb-opticon-fix-dma-from-stack.patch @@ -0,0 +1,44 @@ +From ea0dbebffe118724cd4df7d9b071ea8ee48d48f0 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 25 Oct 2012 10:29:11 +0200 +Subject: USB: opticon: fix DMA from stack + +From: Johan Hovold + +commit ea0dbebffe118724cd4df7d9b071ea8ee48d48f0 upstream. + +Make sure to allocate the control-message buffer dynamically as some +platforms cannot do DMA from stack. + +Note that only the first byte of the old buffer was used. + +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/opticon.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/usb/serial/opticon.c ++++ b/drivers/usb/serial/opticon.c +@@ -160,7 +160,11 @@ static int send_control_msg(struct usb_s + { + struct usb_serial *serial = port->serial; + int retval; +- u8 buffer[2]; ++ u8 *buffer; ++ ++ buffer = kzalloc(1, GFP_KERNEL); ++ if (!buffer) ++ return -ENOMEM; + + buffer[0] = val; + /* Send the message to the vendor control endpoint +@@ -169,6 +173,7 @@ static int send_control_msg(struct usb_s + requesttype, + USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE, + 0, 0, buffer, 1, 0); ++ kfree(buffer); + + return retval; + } diff --git a/queue-3.4/usb-opticon-fix-memory-leak-in-error-path.patch b/queue-3.4/usb-opticon-fix-memory-leak-in-error-path.patch new file mode 100644 index 00000000000..17599ce7633 --- /dev/null +++ b/queue-3.4/usb-opticon-fix-memory-leak-in-error-path.patch @@ -0,0 +1,38 @@ +From acbf0e5263de563e25f7c104868e4490b9e72b13 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 25 Oct 2012 10:29:12 +0200 +Subject: USB: opticon: fix memory leak in error path + +From: Johan Hovold + +commit acbf0e5263de563e25f7c104868e4490b9e72b13 upstream. + +Fix memory leak in write error path. + +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/opticon.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/serial/opticon.c ++++ b/drivers/usb/serial/opticon.c +@@ -297,7 +297,7 @@ static int opticon_write(struct tty_stru + if (!dr) { + dev_err(&port->dev, "out of memory\n"); + count = -ENOMEM; +- goto error; ++ goto error_no_dr; + } + + dr->bRequestType = USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT; +@@ -327,6 +327,8 @@ static int opticon_write(struct tty_stru + + return count; + error: ++ kfree(dr); ++error_no_dr: + usb_free_urb(urb); + error_no_urb: + kfree(buffer); diff --git a/queue-3.4/usb-storage-add-unusual_devs-entry-for-casio-ex-n1-digital-camera.patch b/queue-3.4/usb-storage-add-unusual_devs-entry-for-casio-ex-n1-digital-camera.patch new file mode 100644 index 00000000000..7e597fe674c --- /dev/null +++ b/queue-3.4/usb-storage-add-unusual_devs-entry-for-casio-ex-n1-digital-camera.patch @@ -0,0 +1,39 @@ +From d7870af7e2e3a91b462075ec1ca669b482215187 Mon Sep 17 00:00:00 2001 +From: Michael Shigorin +Date: Mon, 22 Oct 2012 12:18:56 +0300 +Subject: usb-storage: add unusual_devs entry for Casio EX-N1 digital camera + +From: Michael Shigorin + +commit d7870af7e2e3a91b462075ec1ca669b482215187 upstream. + +This commit sets removable subclass for Casio EX-N1 digital camera. + +The patch has been tested within an ALT Linux kernel: +http://git.altlinux.org/people/led/packages/?p=kernel-image-3.0.git;a=commitdiff;h=c0fd891836e89fe0c93a4d536a59216d90e4e3e7 + +See also https://bugzilla.kernel.org/show_bug.cgi?id=49221 + +Signed-off-by: Oleksandr Chumachenko +Signed-off-by: Michael Shigorin +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/unusual_devs.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/usb/storage/unusual_devs.h ++++ b/drivers/usb/storage/unusual_devs.h +@@ -1004,6 +1004,12 @@ UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9 + USB_SC_8070, USB_PR_CB, NULL, + US_FL_NEED_OVERRIDE | US_FL_FIX_INQUIRY ), + ++/* Submitted by Oleksandr Chumachenko */ ++UNUSUAL_DEV( 0x07cf, 0x1167, 0x0100, 0x0100, ++ "Casio", ++ "EX-N1 DigitalCamera", ++ USB_SC_8070, USB_PR_DEVICE, NULL, 0), ++ + /* Submitted by Hartmut Wahl */ + UNUSUAL_DEV( 0x0839, 0x000a, 0x0001, 0x0001, + "Samsung", diff --git a/queue-3.4/usb-whiteheat-fix-memory-leak-in-error-path.patch b/queue-3.4/usb-whiteheat-fix-memory-leak-in-error-path.patch new file mode 100644 index 00000000000..65d8a53d1d7 --- /dev/null +++ b/queue-3.4/usb-whiteheat-fix-memory-leak-in-error-path.patch @@ -0,0 +1,29 @@ +From c129197c99550d356cf5f69b046994dd53cd1b9d Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 25 Oct 2012 10:29:01 +0200 +Subject: USB: whiteheat: fix memory leak in error path + +From: Johan Hovold + +commit c129197c99550d356cf5f69b046994dd53cd1b9d upstream. + +Make sure command buffer is deallocated in case of errors during attach. + +Signed-off-by: Johan Hovold +Cc: +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/whiteheat.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/whiteheat.c ++++ b/drivers/usb/serial/whiteheat.c +@@ -525,6 +525,7 @@ no_firmware: + "%s: please contact support@connecttech.com\n", + serial->type->description); + kfree(result); ++ kfree(command); + return -ENODEV; + + no_command_private: -- 2.47.3