]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.70/s390-qeth-fix-early-exit-from-error-path.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.9.70 / s390-qeth-fix-early-exit-from-error-path.patch
CommitLineData
f1359f75
GKH
1From foo@baz Thu Dec 14 11:45:58 CET 2017
2From: Julian Wiedmann <jwi@linux.vnet.ibm.com>
3Date: Wed, 18 Oct 2017 17:40:17 +0200
4Subject: s390/qeth: fix early exit from error path
5
6From: Julian Wiedmann <jwi@linux.vnet.ibm.com>
7
8
9[ Upstream commit 83cf79a2fec3cf499eb6cb9eb608656fc2a82776 ]
10
11When the allocation of the addr buffer fails, we need to free
12our refcount on the inetdevice before returning.
13
14Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
15Signed-off-by: David S. Miller <davem@davemloft.net>
16Signed-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 }