Skip to content

Commit 08ff781

Browse files
Dan Carpenterkuba-moo
authored andcommitted
octeontx2-pf: Fix an IS_ERR() vs NULL bug
The otx2_mbox_get_rsp() function never returns NULL, it returns error pointers on error. Fixes: 34bfe0e ("octeontx2-pf: MTU, MAC and RX mode config support") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 784f834 commit 08ff781

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ static int otx2_hw_get_mac_addr(struct otx2_nic *pfvf,
171171
}
172172

173173
msghdr = otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
174-
if (!msghdr) {
174+
if (IS_ERR(msghdr)) {
175175
otx2_mbox_unlock(&pfvf->mbox);
176-
return -ENOMEM;
176+
return PTR_ERR(msghdr);
177177
}
178178
rsp = (struct nix_get_mac_addr_rsp *)msghdr;
179179
ether_addr_copy(netdev->dev_addr, rsp->mac_addr);

0 commit comments

Comments
 (0)