Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20610f5b authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Greg Kroah-Hartman
Browse files

s390/qeth: fix early exit from error path




[ Upstream commit 83cf79a2fec3cf499eb6cb9eb608656fc2a82776 ]

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>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 32436bf3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1593,7 +1593,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card,

	addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV4);
	if (!addr)
		return;
		goto out;

	spin_lock_bh(&card->ip_lock);

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

	kfree(addr);
out:
	in_dev_put(in_dev);
}

@@ -1631,7 +1632,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card,

	addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV6);
	if (!addr)
		return;
		goto out;

	spin_lock_bh(&card->ip_lock);

@@ -1646,6 +1647,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card,
	spin_unlock_bh(&card->ip_lock);

	kfree(addr);
out:
	in6_dev_put(in6_dev);
#endif /* CONFIG_QETH_IPV6 */
}