Skip to content

Commit 83cf79a

Browse files
julianwiedmanndavem330
authored andcommitted
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: Julian Wiedmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 025d0df commit 83cf79a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/s390/net/qeth_l3_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card,
15531553

15541554
addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV4);
15551555
if (!addr)
1556-
return;
1556+
goto out;
15571557

15581558
spin_lock_bh(&card->ip_lock);
15591559

@@ -1567,6 +1567,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card,
15671567
spin_unlock_bh(&card->ip_lock);
15681568

15691569
kfree(addr);
1570+
out:
15701571
in_dev_put(in_dev);
15711572
}
15721573

@@ -1591,7 +1592,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card,
15911592

15921593
addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV6);
15931594
if (!addr)
1594-
return;
1595+
goto out;
15951596

15961597
spin_lock_bh(&card->ip_lock);
15971598

@@ -1606,6 +1607,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card,
16061607
spin_unlock_bh(&card->ip_lock);
16071608

16081609
kfree(addr);
1610+
out:
16091611
in6_dev_put(in6_dev);
16101612
#endif /* CONFIG_QETH_IPV6 */
16111613
}

0 commit comments

Comments
 (0)