[PATCH 1/1] net: qed: set error code on failure

2016-12-04 Thread Pan Bian
From: Pan Bian 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,

[PATCH 1/1] net: qed: set error code on failure

2016-12-04 Thread Pan Bian
From: Pan Bian 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"