Skip to content

Commit

Permalink
parport_cs: Fix memory leak in parport_config
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YueHaibing authored and Greg Kroah-Hartman committed Mar 27, 2019
1 parent 8c2ffd9 commit 21c75ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/parport/parport_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 21c75ad

Please sign in to comment.