[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200131050241.aoqatlxubobkmi4y@kili.mountain>
Date: Fri, 31 Jan 2020 08:02:41 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Sunil Goutham <sgoutham@...vell.com>
Cc: Geetha sowjanya <gakula@...vell.com>,
Subbaraya Sundeep <sbhatta@...vell.com>,
hariprasad <hkelam@...vell.com>,
"David S. Miller" <davem@...emloft.net>,
Tomasz Duszynski <tduszynski@...vell.com>,
netdev@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH net] 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: 34bfe0ebedb7 ("octeontx2-pf: MTU, MAC and RX mode config support")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
index 8247d21d0432..b945bd3d5d88 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
@@ -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);
- if (!msghdr) {
+ if (IS_ERR(msghdr)) {
otx2_mbox_unlock(&pfvf->mbox);
- return -ENOMEM;
+ return PTR_ERR(msghdr);
}
rsp = (struct nix_get_mac_addr_rsp *)msghdr;
ether_addr_copy(netdev->dev_addr, rsp->mac_addr);
--
2.11.0
Powered by blists - more mailing lists