提交 e5e03ce1 编写于 作者: S Sjur Braendeland 提交者: David S. Miller

caif: Fix function NULL pointer check.

Check that receive function pointer is not null before calling it.
Signed-off-by: NSjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b04367df
...@@ -173,7 +173,7 @@ static int receive(struct sk_buff *skb, struct net_device *dev, ...@@ -173,7 +173,7 @@ static int receive(struct sk_buff *skb, struct net_device *dev,
net = dev_net(dev); net = dev_net(dev);
pkt = cfpkt_fromnative(CAIF_DIR_IN, skb); pkt = cfpkt_fromnative(CAIF_DIR_IN, skb);
caifd = caif_get(dev); 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; return NET_RX_DROP;
if (caifd->layer.up->receive(caifd->layer.up, pkt)) if (caifd->layer.up->receive(caifd->layer.up, pkt))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册