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: 34bfe0ebed
("octeontx2-pf: MTU, MAC and RX mode config support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
784f8344de
commit
08ff78182f
@ -171,9 +171,9 @@ static int otx2_hw_get_mac_addr(struct otx2_nic *pfvf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
msghdr = otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
|
msghdr = otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
|
||||||
if (!msghdr) {
|
if (IS_ERR(msghdr)) {
|
||||||
otx2_mbox_unlock(&pfvf->mbox);
|
otx2_mbox_unlock(&pfvf->mbox);
|
||||||
return -ENOMEM;
|
return PTR_ERR(msghdr);
|
||||||
}
|
}
|
||||||
rsp = (struct nix_get_mac_addr_rsp *)msghdr;
|
rsp = (struct nix_get_mac_addr_rsp *)msghdr;
|
||||||
ether_addr_copy(netdev->dev_addr, rsp->mac_addr);
|
ether_addr_copy(netdev->dev_addr, rsp->mac_addr);
|
||||||
|
Loading…
Reference in New Issue
Block a user