Skip to content
Commit 1fb3ca76 authored by Kevin Hao's avatar Kevin Hao Committed by David S. Miller
Browse files

net: octeontx2: Fix the confusion in buffer alloc failure path



Pavel pointed that the return of dma_addr_t in
otx2_alloc_rbuf/__otx2_alloc_rbuf() seem suspicious because a negative
error code may be returned in some cases. For a dma_addr_t, the error
code such as -ENOMEM does seem a valid value, so we can't judge if the
buffer allocation fail or not based on that value. Add a parameter for
otx2_alloc_rbuf/__otx2_alloc_rbuf() to store the dma address and make
the return value to indicate if the buffer allocation really fail or
not.

Reported-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
Tested-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
Reviewed-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d816f2a9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment