mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-20 11:13:58 +08:00
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: Aditya Pakki <pakki001@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
bbd20c939c
commit
c5dea81583
@ -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 */
|
||||||
|
Loading…
Reference in New Issue
Block a user