net: atlantic: fix potential error handling
authorPavel Belous <pbelous@marvell.com>
Fri, 14 Feb 2020 15:44:56 +0000 (18:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:43:47 +0000 (16:43 +0100)
commit10b2668cb3db16d8c196e56ee4a75e196b7b7234
treed1d76b4960d5a8bc4c6c3ef3dc145e48c043d88d
parentbe96a355858a47b4374083c258374bd89af35370
net: atlantic: fix potential error handling

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>
drivers/net/ethernet/aquantia/atlantic/aq_nic.c