]> git.karo-electronics.de Git - linux-beck.git/commitdiff
NFC: st21nfca: ERR_PTR vs NULL fix
authorChristophe Ricard <christophe.ricard@gmail.com>
Sat, 13 Sep 2014 08:28:52 +0000 (10:28 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 24 Sep 2014 00:02:24 +0000 (02:02 +0200)
"skb" can be NULL here but it can't be an ERR_PTR:
- IS_ERR(NULL) return false and skb migth be NULL.
- skb cannot be a ERR_PTR as nfc_hci_send_cmd_async it never using such cast.

!skb is more appropriate at those places.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/st21nfca/st21nfca_dep.c

index bf3132ba743c9c4de82ef292cf801c6368cb5d2c..9408122fb948e44c50f4015a7f0dc2a05d8467a2 100644 (file)
@@ -443,7 +443,7 @@ static void st21nfca_im_recv_atr_res_cb(void *context, struct sk_buff *skb,
        if (err != 0)
                return;
 
-       if (IS_ERR(skb))
+       if (!skb)
                return;
 
        switch (info->async_cb_type) {
@@ -555,7 +555,7 @@ static void st21nfca_im_recv_dep_res_cb(void *context, struct sk_buff *skb,
        if (err != 0)
                return;
 
-       if (IS_ERR(skb))
+       if (!skb)
                return;
 
        switch (info->async_cb_type) {