From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Qiang Ning <qning0106@126.com>, Lee Jones <lee@kernel.org>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 5.15 3/4] mfd: dln2: Fix memory leak in dln2_probe()
Date: Wed, 10 May 2023 16:50:07 -0400 [thread overview]
Message-ID: <20230510205008.104981-3-sashal@kernel.org> (raw)
In-Reply-To: <20230510205008.104981-1-sashal@kernel.org>
From: Qiang Ning <qning0106@126.com>
[ Upstream commit 96da8f148396329ba769246cb8ceaa35f1ddfc48 ]
When dln2_setup_rx_urbs() in dln2_probe() fails, error out_free forgets
to call usb_put_dev() to decrease the refcount of dln2->usb_dev.
Fix this by adding usb_put_dev() in the error handling code of
dln2_probe().
Signed-off-by: Qiang Ning <qning0106@126.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230330024353.4503-1-qning0106@126.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mfd/dln2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
index 852129ea07666..fc65f9e25fda8 100644
--- a/drivers/mfd/dln2.c
+++ b/drivers/mfd/dln2.c
@@ -836,6 +836,7 @@ static int dln2_probe(struct usb_interface *interface,
dln2_stop_rx_urbs(dln2);
out_free:
+ usb_put_dev(dln2->usb_dev);
dln2_free(dln2);
return ret;
--
2.39.2
next prev parent reply other threads:[~2023-05-10 20:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-10 20:50 [PATCH AUTOSEL 5.15 1/4] phy: st: miphy28lp: use _poll_timeout functions for waits Sasha Levin
2023-05-10 20:50 ` Sasha Levin
2023-05-10 20:50 ` [PATCH AUTOSEL 5.15 2/4] soundwire: qcom: gracefully handle too many ports in DT Sasha Levin
2023-05-10 20:50 ` Sasha Levin [this message]
2023-05-10 20:50 ` [PATCH AUTOSEL 5.15 4/4] parisc: Replace regular spinlock with spin_trylock on panic path Sasha 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=20230510205008.104981-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qning0106@126.com \
--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 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.