diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-03-21 16:26:28 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-28 01:35:11 +0900 |
commit | 21c75ad65f8e5213ec542d99c259ffe3e3671e81 (patch) | |
tree | 76a6b86049440ba7bca4c577ef9b0f02b204d169 /drivers/parport | |
parent | 8c2ffd9174779014c3fe1f96d9dc3641d9175f00 (diff) | |
download | linux-stable-21c75ad65f8e5213ec542d99c259ffe3e3671e81.tar.gz linux-stable-21c75ad65f8e5213ec542d99c259ffe3e3671e81.tar.bz2 linux-stable-21c75ad65f8e5213ec542d99c259ffe3e3671e81.zip |
parport_cs: Fix memory leak in parport_config
parport_probe() alloc parport device 'info',
but while parport_config failed it does not free it.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/parport_cs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index e9b52e4a4648..e77044c2bf62 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) |