All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "xhci: Fix ring leak in failure path of xhci_alloc_virt_device()" has been added to the 3.18-stable tree
@ 2018-04-03 10:22 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-04-03 10:22 UTC (permalink / raw)
  To: ben.hutchings, gregkh, mathias.nyman, wanghan1995315
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    xhci: Fix ring leak in failure path of xhci_alloc_virt_device()

to the 3.18-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xhci-fix-ring-leak-in-failure-path-of-xhci_alloc_virt_device.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 3ae43090f13b7f6b6a8d4f4889727d2db4e81dd8 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben.hutchings@codethink.co.uk>
Date: Thu, 11 Jan 2018 17:01:36 +0000
Subject: xhci: Fix ring leak in failure path of xhci_alloc_virt_device()

From: Ben Hutchings <ben.hutchings@codethink.co.uk>

This is a stable-only fix for the backport of commit 5d9b70f7d52e
("xhci: Don't add a virt_dev to the devs array before it's fully
allocated").

In branches that predate commit c5628a2af83a ("xhci: remove endpoint
ring cache") there is an additional failure path in
xhci_alloc_virt_device() where ring cache allocation fails, in
which case we need to free the ring allocated for endpoint 0.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Cc: Mathias Nyman <mathias.nyman@intel.com>
Cc: Wang Han <wanghan1995315@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/host/xhci-mem.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1032,7 +1032,8 @@ int xhci_alloc_virt_device(struct xhci_h
 
 	return 1;
 fail:
-
+	if (dev->eps[0].ring)
+		xhci_ring_free(xhci, dev->eps[0].ring);
 	if (dev->in_ctx)
 		xhci_free_container_ctx(xhci, dev->in_ctx);
 	if (dev->out_ctx)


Patches currently in stable-queue which might be from ben.hutchings@codethink.co.uk are

queue-3.18/netlink-avoid-a-double-skb-free-in-genlmsg_mcast.patch
queue-3.18/revert-led-core-fix-brightness-setting-when-setting-delay_off-0.patch
queue-3.18/xhci-fix-ring-leak-in-failure-path-of-xhci_alloc_virt_device.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-03 10:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 10:22 Patch "xhci: Fix ring leak in failure path of xhci_alloc_virt_device()" has been added to the 3.18-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.