mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 01:51:18 +00:00
net: atlantic: fix potential error handling
commit380ec5b9af
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:018423e90b
("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>
This commit is contained in:
parent
be96a35585
commit
10b2668cb3
1 changed files with 3 additions and 1 deletions
|
@ -467,8 +467,10 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self,
|
|||
dx_buff->len,
|
||||
DMA_TO_DEVICE);
|
||||
|
||||
if (unlikely(dma_mapping_error(aq_nic_get_dev(self), dx_buff->pa)))
|
||||
if (unlikely(dma_mapping_error(aq_nic_get_dev(self), dx_buff->pa))) {
|
||||
ret = 0;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
first = dx_buff;
|
||||
dx_buff->len_pkt = skb->len;
|
||||
|
|
Loading…
Reference in a new issue