mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 00:51:35 +00:00
Merge branch 'kfree_skb-NULL'
zhong jiang says: ==================== net: remove redundant null pointer check before kfree_skb The issue is detected with the help of Coccinelle. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
1ba2a720da
6 changed files with 9 additions and 18 deletions
|
@ -3422,8 +3422,7 @@ static void remove_one(struct pci_dev *pdev)
|
||||||
free_netdev(adapter->port[i]);
|
free_netdev(adapter->port[i]);
|
||||||
|
|
||||||
iounmap(adapter->regs);
|
iounmap(adapter->regs);
|
||||||
if (adapter->nofail_skb)
|
kfree_skb(adapter->nofail_skb);
|
||||||
kfree_skb(adapter->nofail_skb);
|
|
||||||
kfree(adapter);
|
kfree(adapter);
|
||||||
pci_release_regions(pdev);
|
pci_release_regions(pdev);
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
|
|
|
@ -1302,8 +1302,7 @@ void cxgb3_offload_deactivate(struct adapter *adapter)
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
RCU_INIT_POINTER(tdev->l2opt, NULL);
|
RCU_INIT_POINTER(tdev->l2opt, NULL);
|
||||||
call_rcu(&d->rcu_head, clean_l2_data);
|
call_rcu(&d->rcu_head, clean_l2_data);
|
||||||
if (t->nofail_skb)
|
kfree_skb(t->nofail_skb);
|
||||||
kfree_skb(t->nofail_skb);
|
|
||||||
kfree(t);
|
kfree(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -830,8 +830,7 @@ static ssize_t tap_do_read(struct tap_queue *q,
|
||||||
ssize_t ret = 0;
|
ssize_t ret = 0;
|
||||||
|
|
||||||
if (!iov_iter_count(to)) {
|
if (!iov_iter_count(to)) {
|
||||||
if (skb)
|
kfree_skb(skb);
|
||||||
kfree_skb(skb);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1236,8 +1235,7 @@ static int tap_recvmsg(struct socket *sock, struct msghdr *m,
|
||||||
struct sk_buff *skb = m->msg_control;
|
struct sk_buff *skb = m->msg_control;
|
||||||
int ret;
|
int ret;
|
||||||
if (flags & ~(MSG_DONTWAIT|MSG_TRUNC)) {
|
if (flags & ~(MSG_DONTWAIT|MSG_TRUNC)) {
|
||||||
if (skb)
|
kfree_skb(skb);
|
||||||
kfree_skb(skb);
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
ret = tap_do_read(q, &m->msg_iter, flags & MSG_DONTWAIT, skb);
|
ret = tap_do_read(q, &m->msg_iter, flags & MSG_DONTWAIT, skb);
|
||||||
|
|
|
@ -260,8 +260,7 @@ out:
|
||||||
spin_unlock(&qp->q.lock);
|
spin_unlock(&qp->q.lock);
|
||||||
out_rcu_unlock:
|
out_rcu_unlock:
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
if (head)
|
kfree_skb(head);
|
||||||
kfree_skb(head);
|
|
||||||
ipq_put(qp);
|
ipq_put(qp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -468,12 +468,10 @@ void inet6_destroy_sock(struct sock *sk)
|
||||||
/* Release rx options */
|
/* Release rx options */
|
||||||
|
|
||||||
skb = xchg(&np->pktoptions, NULL);
|
skb = xchg(&np->pktoptions, NULL);
|
||||||
if (skb)
|
kfree_skb(skb);
|
||||||
kfree_skb(skb);
|
|
||||||
|
|
||||||
skb = xchg(&np->rxpmtu, NULL);
|
skb = xchg(&np->rxpmtu, NULL);
|
||||||
if (skb)
|
kfree_skb(skb);
|
||||||
kfree_skb(skb);
|
|
||||||
|
|
||||||
/* Free flowlabels */
|
/* Free flowlabels */
|
||||||
fl6_free_socklist(sk);
|
fl6_free_socklist(sk);
|
||||||
|
|
|
@ -192,10 +192,8 @@ static void nci_uart_tty_close(struct tty_struct *tty)
|
||||||
if (!nu)
|
if (!nu)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (nu->tx_skb)
|
kfree_skb(nu->tx_skb);
|
||||||
kfree_skb(nu->tx_skb);
|
kfree_skb(nu->rx_skb);
|
||||||
if (nu->rx_skb)
|
|
||||||
kfree_skb(nu->rx_skb);
|
|
||||||
|
|
||||||
skb_queue_purge(&nu->tx_q);
|
skb_queue_purge(&nu->tx_q);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue