Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5e03ce1 authored by Sjur Braendeland's avatar Sjur Braendeland Committed by David S. Miller
Browse files

caif: Fix function NULL pointer check.



Check that receive function pointer is not null before calling it.

Signed-off-by: default avatarSjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b04367df
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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))