Commit 83cf79a2 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: fix early exit from error path

When the allocation of the addr buffer fails, we need to free
our refcount on the inetdevice before returning.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 025d0dfc
...@@ -1553,7 +1553,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card, ...@@ -1553,7 +1553,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card,
addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV4); addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV4);
if (!addr) if (!addr)
return; goto out;
spin_lock_bh(&card->ip_lock); spin_lock_bh(&card->ip_lock);
...@@ -1567,6 +1567,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card, ...@@ -1567,6 +1567,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card,
spin_unlock_bh(&card->ip_lock); spin_unlock_bh(&card->ip_lock);
kfree(addr); kfree(addr);
out:
in_dev_put(in_dev); in_dev_put(in_dev);
} }
...@@ -1591,7 +1592,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card, ...@@ -1591,7 +1592,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card,
addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV6); addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV6);
if (!addr) if (!addr)
return; goto out;
spin_lock_bh(&card->ip_lock); spin_lock_bh(&card->ip_lock);
...@@ -1606,6 +1607,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card, ...@@ -1606,6 +1607,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card,
spin_unlock_bh(&card->ip_lock); spin_unlock_bh(&card->ip_lock);
kfree(addr); kfree(addr);
out:
in6_dev_put(in6_dev); in6_dev_put(in6_dev);
#endif /* CONFIG_QETH_IPV6 */ #endif /* CONFIG_QETH_IPV6 */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment