OSDN Git Service

ipvlan: Remove redundant if statements
authorXu Wang <vulab@iscas.ac.cn>
Thu, 2 Dec 2021 07:53:59 +0000 (07:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Dec 2021 13:07:38 +0000 (13:07 +0000)
The 'if (dev)' statement already move into dev_{put , hold}, so remove
redundant if statements.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipvlan/ipvlan_core.c
drivers/net/ipvlan/ipvlan_main.c

index 6cd5010..c613900 100644 (file)
@@ -291,8 +291,7 @@ void ipvlan_process_multicast(struct work_struct *work)
                        else
                                kfree_skb(skb);
                }
-               if (dev)
-                       dev_put(dev);
+               dev_put(dev);
                cond_resched();
        }
 }
index 20da0b2..696e245 100644 (file)
@@ -100,8 +100,7 @@ static void ipvlan_port_destroy(struct net_device *dev)
        netdev_rx_handler_unregister(dev);
        cancel_work_sync(&port->wq);
        while ((skb = __skb_dequeue(&port->backlog)) != NULL) {
-               if (skb->dev)
-                       dev_put(skb->dev);
+               dev_put(skb->dev);
                kfree_skb(skb);
        }
        ida_destroy(&port->ida);