]>
Commit | Line | Data |
---|---|---|
f1359f75 GKH |
1 | From foo@baz Thu Dec 14 11:45:58 CET 2017 |
2 | From: Julian Wiedmann <jwi@linux.vnet.ibm.com> | |
3 | Date: Wed, 18 Oct 2017 17:40:17 +0200 | |
4 | Subject: s390/qeth: fix early exit from error path | |
5 | ||
6 | From: Julian Wiedmann <jwi@linux.vnet.ibm.com> | |
7 | ||
8 | ||
9 | [ Upstream commit 83cf79a2fec3cf499eb6cb9eb608656fc2a82776 ] | |
10 | ||
11 | When the allocation of the addr buffer fails, we need to free | |
12 | our refcount on the inetdevice before returning. | |
13 | ||
14 | Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> | |
15 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
16 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
17 | --- | |
18 | drivers/s390/net/qeth_l3_main.c | 6 ++++-- | |
19 | 1 file changed, 4 insertions(+), 2 deletions(-) | |
20 | ||
21 | --- a/drivers/s390/net/qeth_l3_main.c | |
22 | +++ b/drivers/s390/net/qeth_l3_main.c | |
23 | @@ -1593,7 +1593,7 @@ static void qeth_l3_free_vlan_addresses4 | |
24 | ||
25 | addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV4); | |
26 | if (!addr) | |
27 | - return; | |
28 | + goto out; | |
29 | ||
30 | spin_lock_bh(&card->ip_lock); | |
31 | ||
32 | @@ -1607,6 +1607,7 @@ static void qeth_l3_free_vlan_addresses4 | |
33 | spin_unlock_bh(&card->ip_lock); | |
34 | ||
35 | kfree(addr); | |
36 | +out: | |
37 | in_dev_put(in_dev); | |
38 | } | |
39 | ||
40 | @@ -1631,7 +1632,7 @@ static void qeth_l3_free_vlan_addresses6 | |
41 | ||
42 | addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV6); | |
43 | if (!addr) | |
44 | - return; | |
45 | + goto out; | |
46 | ||
47 | spin_lock_bh(&card->ip_lock); | |
48 | ||
49 | @@ -1646,6 +1647,7 @@ static void qeth_l3_free_vlan_addresses6 | |
50 | spin_unlock_bh(&card->ip_lock); | |
51 | ||
52 | kfree(addr); | |
53 | +out: | |
54 | in6_dev_put(in6_dev); | |
55 | #endif /* CONFIG_QETH_IPV6 */ | |
56 | } |