From: Dan Carpenter <dan.carpenter@oracle.com>
To: Felipe Balbi <balbi@kernel.org>, Christoph Hellwig <hch@lst.de>,
Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
Bart Van Assche <bart.vanassche@sandisk.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
target-devel@vger.kernel.org
Subject: [patch -target tree] usb: gadget: f_tcm: use after free
Date: Wed, 2 Mar 2016 13:08:48 +0300 [thread overview]
Message-ID: <20160302100848.GC5533@mwanda> (raw)
We need to move the kfree() down a line so we don't dereference a freed
variable.
Fixes: 1b418a8fcbc0 ('target: Convert demo-mode only drivers to target_alloc_session')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c
index 7276a73..e352a31 100644
--- a/drivers/usb/gadget/function/f_tcm.c
+++ b/drivers/usb/gadget/function/f_tcm.c
@@ -1596,8 +1596,8 @@ static int tcm_usbg_make_nexus(struct usbg_tpg *tpg, char *name)
#define MAKE_NEXUS_MSG "core_tpg_check_initiator_node_acl() failed for %s\n"
pr_debug(MAKE_NEXUS_MSG, name);
#undef MAKE_NEXUS_MSG
- kfree(tv_nexus);
ret = PTR_ERR(tv_nexus->tvn_se_sess);
+ kfree(tv_nexus);
}
out_unlock:
next reply other threads:[~2016-03-02 10:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-02 10:08 Dan Carpenter [this message]
2016-03-02 11:55 ` [patch -target tree] usb: gadget: f_tcm: use after free Felipe Balbi
2016-03-05 7:26 ` Nicholas A. Bellinger
2016-03-09 11:38 ` Felipe Balbi
2016-03-10 6:23 ` Nicholas A. Bellinger
2016-03-09 12:53 ` Andrzej Pietrasiewicz
2016-03-10 5:19 ` Nicholas A. Bellinger
2016-03-10 8:34 ` Andrzej Pietrasiewicz
2016-03-11 4:10 ` Nicholas A. Bellinger
2016-03-05 7:20 ` Nicholas A. Bellinger
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=20160302100848.GC5533@mwanda \
--to=dan.carpenter@oracle.com \
--cc=andrzej.p@samsung.com \
--cc=balbi@kernel.org \
--cc=bart.vanassche@sandisk.com \
--cc=bigeasy@linutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=target-devel@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;
as well as URLs for NNTP newsgroup(s).