Skip to content

Commit

Permalink
caif: added check for potential null return
Browse files Browse the repository at this point in the history
Add check on NULL return from caif_get().

Signed-off-by: Kim Lilliestierna <Kim.xx.Lilliestierna@stericsson.com>
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericssion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kim Lilliestierna XX authored and davem330 committed Jun 25, 2012
1 parent be4852c commit c95567c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/caif/caif_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ void caif_flow_cb(struct sk_buff *skb)

rcu_read_lock();
caifd = caif_get(skb->dev);

WARN_ON(caifd == NULL);
if (caifd == NULL)
return;

caifd_hold(caifd);
rcu_read_unlock();

Expand Down

0 comments on commit c95567c

Please sign in to comment.