Skip to content

Commit c95567c

Browse files
Kim Lilliestierna XXdavem330
authored andcommitted
caif: added check for potential null return
Add check on NULL return from caif_get(). Signed-off-by: Kim Lilliestierna <[email protected]> Signed-off-by: Sjur Brændeland <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent be4852c commit c95567c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/caif/caif_dev.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ void caif_flow_cb(struct sk_buff *skb)
128128

129129
rcu_read_lock();
130130
caifd = caif_get(skb->dev);
131+
132+
WARN_ON(caifd == NULL);
133+
if (caifd == NULL)
134+
return;
135+
131136
caifd_hold(caifd);
132137
rcu_read_unlock();
133138

0 commit comments

Comments
 (0)