Commit c5dea815 authored by Aditya Pakki's avatar Aditya Pakki Committed by David S. Miller
Browse files

net: caif: replace BUG_ON with recovery code



In caif_xmit, there is a crash if the ptr dev is NULL. However, by
returning the error to the callers, the error can be handled. The
patch fixes this issue.

Signed-off-by: default avatarAditya Pakki <pakki001@umn.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bbd20c93
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -270,7 +270,9 @@ static int caif_xmit(struct sk_buff *skb, struct net_device *dev)
{
	struct ser_device *ser;

	BUG_ON(dev == NULL);
	if (WARN_ON(!dev))
		return -EINVAL;

	ser = netdev_priv(dev);

	/* Send flow off once, on high water mark */