Skip to content

Commit

Permalink
NFC: st21nfca: ERR_PTR vs NULL fix
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Christophe Ricard authored and Samuel Ortiz committed Sep 24, 2014
1 parent bc6b827 commit 459e794
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nfc/st21nfca/st21nfca_dep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 459e794

Please sign in to comment.