mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: alexander.levin@verizon.com
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: John Keeping <john@metanate.com>,
	Felipe Balbi <felipe.balbi@linux.intel.com>,
	alexander.levin@verizon.com
Subject: [PATCH AUTOSEL for 3.18 02/16] usb: gadget: configs: plug memory leak
Date: Wed, 29 Nov 2017 17:22:19 +0000	[thread overview]
Message-ID: <20171129172213.29007-2-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171129172213.29007-1-alexander.levin@verizon.com>

From: John Keeping <john@metanate.com>

[ Upstream commit 38355b2a44776c25b0f2ad466e8c51bb805b3032 ]

When binding a gadget to a device, "name" is stored in gi->udc_name, but
this does not happen when unregistering and the string is leaked.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/usb/gadget/configfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index a7e1a96e69a5..156c252c5aab 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -266,6 +266,7 @@ static ssize_t gadget_dev_desc_UDC_store(struct gadget_info *gi,
 		ret = unregister_gadget(gi);
 		if (ret)
 			goto err;
+		kfree(name);
 	} else {
 		if (gi->udc_name) {
 			ret = -EBUSY;
-- 
2.11.0

  parent reply	other threads:[~2017-11-29 17:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 17:22 [PATCH AUTOSEL for 3.18 01/16] selftest/powerpc: Fix false failures for skipped tests alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 03/16] USB: gadgetfs: Fix a potential memory leak in 'dev_config()' alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 04/16] libata: drop WARN from protocol error in ata_sff_qc_issue() alexander.levin
2017-11-29 17:22 ` alexander.levin [this message]
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 07/16] irqchip/crossbar: Fix incorrect type of register size alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 05/16] workqueue: trigger WARN if queue_delayed_work() is called with NULL @wq alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 06/16] scsi: lpfc: Fix crash during Hardware error recovery on SLI3 adapters alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 08/16] KVM: nVMX: reset nested_run_pending if the vCPU is going to be reset alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 12/16] ipv6: reorder icmpv6_init() and ip6_mr_init() alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 09/16] arm: KVM: Survive unknown traps from guests alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 10/16] spi_ks8995: fix "BUG: key accdaa28 not in .data!" alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 11/16] bnx2x: fix possible overrun of VFPF multicast addresses array alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 13/16] crypto: s5p-sss - Fix completing crypto request in IRQ handler alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 14/16] i2c: riic: fix restart condition alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 15/16] axonram: Fix gendisk handling alexander.levin
2017-11-29 17:22 ` [PATCH AUTOSEL for 3.18 16/16] EDAC, i5000, i5400: Fix use of MTR_DRAM_WIDTH macro alexander.levin
2017-11-30  1:34   ` Jérémy Lefaure
2017-11-30 21:33     ` alexander.levin

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=20171129172213.29007-2-alexander.levin@verizon.com \
    --to=alexander.levin@verizon.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=john@metanate.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.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

all inboxes | Powered by JetHome®