Skip to content

Commit

Permalink
parport: fix possible memory leak in parport_gsc_probe_port()
Browse files Browse the repository at this point in the history
ops has been allocated in this function and should be freed
before leaving from the error handling cases.

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Sep 5, 2012
1 parent f21ec3d commit 9986ffd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/parport/parport_gsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base,
if (!parport_SPP_supported (p)) {
/* No port. */
kfree (priv);
kfree(ops);
return NULL;
}
parport_PS2_supported (p);
Expand Down

0 comments on commit 9986ffd

Please sign in to comment.