[openwrt/openwrt] staging: mt7621-eth: fix return value check in mtk_probe()

LEDE Commits lede-commits at lists.infradead.org
Mon May 14 21:52:57 PDT 2018


blogic pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/c4ae54dfabc982d9b8865984b91e493745da12e2

commit c4ae54dfabc982d9b8865984b91e493745da12e2
Author: Wei Yongjun <weiyongjun1 at huawei.com>
AuthorDate: Mon May 14 11:14:23 2018 -0700

    staging: mt7621-eth: fix return value check in mtk_probe()
    
    In case of error, the function devm_ioremap_resource() returns ERR_PTR()
    and never returns NULL. The NULL test in the return value check should
    be replaced with IS_ERR().
    
    Fixes: e3cbf478f846 ("staging: mt7621-eth: add the drivers core files")
    Signed-off-by: Wei Yongjun <weiyongjun1 at huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c
index d0d88b9..c806e28 100644
--- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c
+++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c
@@ -1513,7 +1513,7 @@ static int fe_probe(struct platform_device *pdev)
 		soc->reg_table = fe_reg_table;
 
 	fe_base = devm_ioremap_resource(&pdev->dev, res);
-	if (!fe_base) {
+	if (IS_ERR(fe_base)) {
 		err = -EADDRNOTAVAIL;
 		goto err_out;
 	}



More information about the lede-commits mailing list