From: Yue Haibing <yuehaibing@huawei.com>
To: <sudipm.mukherjee@gmail.com>, <gregkh@linuxfoundation.org>
Cc: <linux-kernel@vger.kernel.org>, YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH] parport_cs: Fix memory leak in parport_config
Date: Thu, 21 Mar 2019 16:26:28 +0800 [thread overview]
Message-ID: <20190321082628.14384-1-yuehaibing@huawei.com> (raw)
From: YueHaibing <yuehaibing@huawei.com>
parport_probe() alloc parport device 'info',
but while parport_config failed it does not free it.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/parport/parport_cs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index e9b52e4..e77044c2 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -158,8 +158,9 @@ static int parport_config(struct pcmcia_device *link)
return 0;
failed:
- parport_cs_release(link);
- return -ENODEV;
+ parport_cs_release(link);
+ kfree(link->priv);
+ return -ENODEV;
} /* parport_config */
static void parport_cs_release(struct pcmcia_device *link)
--
2.7.0
next reply other threads:[~2019-03-21 8:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-21 8:26 Yue Haibing [this message]
[not found] ` <d59d35b9-7fb0-d1f0-b63c-4f7c2ff354e0@codeaurora.org>
2019-03-27 16:34 ` Greg KH
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=20190321082628.14384-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
/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®