Skip to content

Commit

Permalink
caif: Fix function NULL pointer check.
Browse files Browse the repository at this point in the history
Check that receive function pointer is not null before calling it.

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sjur Braendeland authored and David S. Miller committed Sep 22, 2010
1 parent b04367d commit e5e03ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/caif/caif_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static int receive(struct sk_buff *skb, struct net_device *dev,
net = dev_net(dev);
pkt = cfpkt_fromnative(CAIF_DIR_IN, skb);
caifd = caif_get(dev);
if (!caifd || !caifd->layer.up || !caifd->layer.up->ctrlcmd)
if (!caifd || !caifd->layer.up || !caifd->layer.up->receive)
return NET_RX_DROP;

if (caifd->layer.up->receive(caifd->layer.up, pkt))
Expand Down

0 comments on commit e5e03ce

Please sign in to comment.