]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
net: atlantic: fix potential error handling
authorPavel Belous <pbelous@marvell.com>
Fri, 14 Feb 2020 15:44:56 +0000 (18:44 +0300)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 6 Mar 2020 11:38:25 +0000 (12:38 +0100)
commita8c46714ed43390394c98b86bb683949cd2eaed3
tree54a49a3507a4dee0f385936c141a95950f962c13
parent7b1cb5e00e816137931e75de3e0c8c93d36682e4
net: atlantic: fix potential error handling

BugLink: https://bugs.launchpad.net/bugs/1866333
commit 380ec5b9af7f0d57dbf6ac067fd9f33cff2fef71 upstream.

Code inspection found that in case of mapping error we do return current
'ret' value. But beside error, it is used to count number of descriptors
allocated for the packet. In that case map_skb function could return '1'.

Changing it to return zero (number of mapped descriptors for skb)

Fixes: 018423e90bee ("net: ethernet: aquantia: Add ring support code")
Signed-off-by: Pavel Belous <pbelous@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/ethernet/aquantia/atlantic/aq_nic.c