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

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
...@@ -270,7 +270,9 @@ static int caif_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -270,7 +270,9 @@ static int caif_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct ser_device *ser; struct ser_device *ser;
BUG_ON(dev == NULL); if (WARN_ON(!dev))
return -EINVAL;
ser = netdev_priv(dev); ser = netdev_priv(dev);
/* Send flow off once, on high water mark */ /* Send flow off once, on high water mark */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment