]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: qlogic: set error code on failure
authorPan Bian <bianpan2016@163.com>
Sun, 4 Dec 2016 05:53:53 +0000 (13:53 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Dec 2016 19:54:18 +0000 (14:54 -0500)
commit422137b62a2d92c03e413e49b9b2cbe43df2d858
treece7a418232fddd07970d141154170161e2a1d67b
parent152a1d615cac9a7e8928bb78e70aabb5bab7079e
net: ethernet: qlogic: set error code on failure

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 <bianpan2016@163.com>
Acked-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_ll2.c