Skip to content

Commit ad1f379

Browse files
Colin Ian Kingdavem330
authored andcommitted
octeontx2-pf: Fix assigned error return value that is never used
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: 79d2be3 ("octeontx2-pf: offload DMAC filters to CGX/RPM block") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5ddef2a commit ad1f379

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ int otx2_dmacflt_update(struct otx2_nic *pf, u8 *mac, u8 bit_pos)
161161

162162
if (!req) {
163163
mutex_unlock(&pf->mbox.lock);
164-
rc = -ENOMEM;
164+
return -ENOMEM;
165165
}
166166

167167
ether_addr_copy(req->mac_addr, mac);

0 commit comments

Comments
 (0)