summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorArthur Kiyanovski <akiyano@amazon.com>2020-05-22 12:08:55 +0300
committerDavid S. Miller <davem@davemloft.net>2020-05-22 14:12:48 -0700
commitadb3fb388933e03c61e941bce4a0dac4a6ae98c0 (patch)
tree887ef5ee10bea9d76d3d7a5525fc5df8e2a07238 /drivers/net
parentf391503b7a11c6ca033a6e916cee23b85e21a1f1 (diff)
net: ena: fix ena_com_comp_status_to_errno() return value
Default return value should be -EINVAL since the input in this case was unexpected. Also remove the now redundant check in the beginning of the function. Signed-off-by: Sameeh Jubran <sameehj@amazon.com> Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/amazon/ena/ena_com.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c
index 02780f9fa586..921945dace22 100644
--- a/drivers/net/ethernet/amazon/ena/ena_com.c
+++ b/drivers/net/ethernet/amazon/ena/ena_com.c
@@ -523,9 +523,6 @@ static int ena_com_comp_status_to_errno(u8 comp_status)
if (unlikely(comp_status != 0))
pr_err("admin command failed[%u]\n", comp_status);
- if (unlikely(comp_status > ENA_ADMIN_UNKNOWN_ERROR))
- return -EINVAL;
-
switch (comp_status) {
case ENA_ADMIN_SUCCESS:
return 0;
@@ -540,7 +537,7 @@ static int ena_com_comp_status_to_errno(u8 comp_status)
return -EINVAL;
}
- return 0;
+ return -EINVAL;
}
static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx,