linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] octeontx2-pf: Fix assigned error return value that is never used
@ 2021-07-06 11:18 Colin King
  2021-07-06 22:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-07-06 11:18 UTC (permalink / raw)
  To: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	David S . Miller, Jakub Kicinski, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently when the call to otx2_mbox_alloc_msg_cgx_mac_addr_update fails
the error return variable rc is being assigned -ENOMEM and does not
return early. rc is then re-assigned and the error case is not handled
correctly. Fix this by returning -ENOMEM rather than assigning rc.

Addresses-Coverity: ("Unused value")
Fixes: 79d2be385e9e ("octeontx2-pf: offload DMAC filters to CGX/RPM block")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c
index ffe3e94562d0..383a6b5cb698 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c
@@ -161,7 +161,7 @@ int otx2_dmacflt_update(struct otx2_nic *pf, u8 *mac, u8 bit_pos)
 
 	if (!req) {
 		mutex_unlock(&pf->mbox.lock);
-		rc = -ENOMEM;
+		return -ENOMEM;
 	}
 
 	ether_addr_copy(req->mac_addr, mac);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] octeontx2-pf: Fix assigned error return value that is never used
  2021-07-06 11:18 [PATCH][next] octeontx2-pf: Fix assigned error return value that is never used Colin King
@ 2021-07-06 22:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-06 22:30 UTC (permalink / raw)
  To: Colin King
  Cc: sgoutham, gakula, sbhatta, hkelam, davem, kuba, netdev,
	kernel-janitors, linux-kernel

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Tue,  6 Jul 2021 12:18:02 +0100 you wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently when the call to otx2_mbox_alloc_msg_cgx_mac_addr_update fails
> the error return variable rc is being assigned -ENOMEM and does not
> return early. rc is then re-assigned and the error case is not handled
> correctly. Fix this by returning -ENOMEM rather than assigning rc.
> 
> [...]

Here is the summary with links:
  - [next] octeontx2-pf: Fix assigned error return value that is never used
    https://git.kernel.org/netdev/net/c/ad1f37970875

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-06 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 11:18 [PATCH][next] octeontx2-pf: Fix assigned error return value that is never used Colin King
2021-07-06 22:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).