From: kernel test robot <l...@intel.com>

drivers/net/wwan/mhi_wwan_ctrl.c:239:5-11: inconsistent IS_ERR and PTR_ERR on 
line 241.

 PTR_ERR should access the value just tested by IS_ERR

Semantic patch information:
 There can be false positives in the patch case, where it is the call to
 IS_ERR that is wrong.

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

CC: Loic Poulain <loic.poul...@linaro.org>
Reported-by: kernel test robot <l...@intel.com>
Signed-off-by: kernel test robot <l...@intel.com>
---

url:    
https://github.com/0day-ci/linux/commits/Loic-Poulain/net-Add-a-WWAN-subsystem/20210405-174547
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
7d42e84eb99daf9b7feef37e8f2ea1eaf975346b

 mhi_wwan_ctrl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wwan/mhi_wwan_ctrl.c
+++ b/drivers/net/wwan/mhi_wwan_ctrl.c
@@ -238,7 +238,7 @@ static int mhi_wwan_ctrl_probe(struct mh
                                &wwan_pops, mhiwwan);
        if (IS_ERR(mhiwwan->wwan_port)) {
                kfree(mhiwwan);
-               return PTR_ERR(port);
+               return PTR_ERR(mhiwwan->wwan_port);
        }
 
        mhiwwan->wwan_port = port;

Reply via email to