diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-09-24 04:24:25 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-24 15:45:17 -0400 |
commit | f68bd07c41f93a4291d3605d5b5ac254340c439e (patch) | |
tree | 51f6c0294f6d52465827058413dd0e2aaf66e63e /drivers/s390 | |
parent | 3c7874758743a857cadbb9eaf42825d75370dacd (diff) | |
download | linux-f68bd07c41f93a4291d3605d5b5ac254340c439e.tar.gz linux-f68bd07c41f93a4291d3605d5b5ac254340c439e.tar.bz2 linux-f68bd07c41f93a4291d3605d5b5ac254340c439e.zip |
qeth: fix possible memory leak in qeth_l3_add_[vipa|rxip]()
ipaddr has been allocated in function qeth_l3_add_vipa() but
does not free before leaving from the error handling cases. The
same problem also exists in function qeth_l3_add_rxip().
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: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index c5f03fa70fba..4cd310cb5bdf 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -794,6 +794,7 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto, rc = -EEXIST; spin_unlock_irqrestore(&card->ip_lock, flags); if (rc) { + kfree(ipaddr); return rc; } if (!qeth_l3_add_ip(card, ipaddr)) @@ -858,6 +859,7 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto, rc = -EEXIST; spin_unlock_irqrestore(&card->ip_lock, flags); if (rc) { + kfree(ipaddr); return rc; } if (!qeth_l3_add_ip(card, ipaddr)) |