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

Commit 144a6adf authored by zhong jiang's avatar zhong jiang Committed by David S. Miller
Browse files

net: tap: remove redundant null pointer check before kfree_skb



kfree_skb has taken the null pointer into account. hence it is safe
to remove the redundant null pointer check before kfree_skb.

Signed-off-by: default avatarzhong jiang <zhongjiang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68c38507
Loading
Loading
Loading
Loading
+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;
	}