1
0
Fork 0

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>
hifive-unleashed-5.2
YueHaibing 2019-03-21 16:26:28 +08:00 committed by Greg Kroah-Hartman
parent 8c2ffd9174
commit 21c75ad65f
1 changed files with 3 additions and 2 deletions

View File

@ -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)