Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ba2a720 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 68c38507 f2a2f216
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3422,7 +3422,6 @@ static void remove_one(struct pci_dev *pdev)
				free_netdev(adapter->port[i]);

		iounmap(adapter->regs);
		if (adapter->nofail_skb)
		kfree_skb(adapter->nofail_skb);
		kfree(adapter);
		pci_release_regions(pdev);
+1 −2
Original line number Diff line number Diff line
@@ -1302,7 +1302,6 @@ void cxgb3_offload_deactivate(struct adapter *adapter)
	rcu_read_unlock();
	RCU_INIT_POINTER(tdev->l2opt, NULL);
	call_rcu(&d->rcu_head, clean_l2_data);
	if (t->nofail_skb)
	kfree_skb(t->nofail_skb);
	kfree(t);
}
+2 −4
Original line number Diff line number Diff line
@@ -830,7 +830,6 @@ static ssize_t tap_do_read(struct tap_queue *q,
	ssize_t ret = 0;

	if (!iov_iter_count(to)) {
		if (skb)
		kfree_skb(skb);
		return 0;
	}
@@ -1236,7 +1235,6 @@ static int tap_recvmsg(struct socket *sock, struct msghdr *m,
	struct sk_buff *skb = m->msg_control;
	int ret;
	if (flags & ~(MSG_DONTWAIT|MSG_TRUNC)) {
		if (skb)
		kfree_skb(skb);
		return -EINVAL;
	}
+1 −2
Original line number Diff line number Diff line
@@ -260,7 +260,6 @@ static void ip_expire(struct timer_list *t)
	spin_unlock(&qp->q.lock);
out_rcu_unlock:
	rcu_read_unlock();
	if (head)
	kfree_skb(head);
	ipq_put(qp);
}
+2 −4
Original line number Diff line number Diff line
@@ -468,11 +468,9 @@ void inet6_destroy_sock(struct sock *sk)
	/* Release rx options */

	skb = xchg(&np->pktoptions, NULL);
	if (skb)
	kfree_skb(skb);

	skb = xchg(&np->rxpmtu, NULL);
	if (skb)
	kfree_skb(skb);

	/* Free flowlabels */
Loading