sfc: Fix missing error code in efx_reset_up()
Subsystems (4)
PATCH 1/1 sfc: Fix missing error code in efx_reset_up()
The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'rc'.
Eliminate the follow smatch warning:
drivers/net/ethernet/sfc/efx_common.c:758 efx_reset_up() warn: missing error code 'rc'.
Reported-by Abaci Robot <[email protected]>
Signed-off-by Jiapeng Chong <[email protected]>
--- drivers/net/ethernet/sfc/efx_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/sfc/efx_common.c +3 -1
@@ -754,8 +754,10 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok) goto fail; } -if (!ok) +if (!ok) { + rc = -EINVAL ; goto fail; + }if (efx->port_initialized && method !=RESET_TYPE_INVISIBLE && method !=RESET_TYPE_DATAPATH ) {
Signature · 1 line
2.20.1.7.g153144c
Quoted 7 lines · Jiapeng Chong
The error code is missing in this code scenario, add the error code '
-EINVAL' to the return value 'rc'.Eliminate the follow smatch warning:
drivers/net/ethernet/sfc/efx_common.c:758efx_reset_up()warn: missing error code 'rc'.
The warning is not correct. We want to return an rc of 0 in this case, and that is what rc is already set to given the earlier code.
Martin
Quoted 25 lines
Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- drivers/net/ethernet/sfc/efx_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/ethernet/sfc/efx_common.c +3
-1@@ -754,8 +754,10 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok) goto fail; } -if (!ok) +if (!ok) { + rc = -EINVAL ; goto fail; + }if (efx->port_initialized && method !=RESET_TYPE_INVISIBLE && method !=RESET_TYPE_DATAPATH ) {Signature · 1 line
2.20.1.7.g153144c