From: "Mintz, Yuval" <yuval.mi...@cavium.com>
Date: Sun, 4 Dec 2016 07:29:58 +0000

>> From: Pan Bian <bianpan2...@163.com>
>> 
>> When calling dma_mapping_error(), the value of return variable rc is 0.
>> And when the call returns an unexpected value, rc is not set to a negative
>> errno. Thus, it will return 0 on the error path, and its callers cannot 
>> detect
>> the bug. This patch fixes the bug, assigning "-ENOMEM" to err.
>> 
>> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189041
>> 
>> Signed-off-by: Pan Bian <bianpan2...@163.com>
> 
> The title should have been "[PATCH net 1/1] qed: Set error code on failure".
> 
> But the fix itself is sound. Thanks.
> BTW, is -ENOMEM the right return code in case of DMA mapping errors?
> 
> Acked-by: Yuval Mintz <yuval.mi...@cavium.com>

Applied.

Indeed, -ENOMEM is usually the right thing to use for DMA mapping errors.
Because usually the error is because we're run out of IOMMU resources
or similar.  And -ENOMEM is pretty much the error code which maps most
closely to that situation.

Reply via email to