Unverified Commit deffb643 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9201 ipv6: fix potential "struct net" leak in inet6_rtm_getaddr()

parents f46ad1d4 45c61993
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -5443,9 +5443,10 @@ static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr *nlh,
	}

	addr = extract_addr(tb[IFA_ADDRESS], tb[IFA_LOCAL], &peer);
	if (!addr)
		return -EINVAL;

	if (!addr) {
		err = -EINVAL;
		goto errout;
	}
	ifm = nlmsg_data(nlh);
	if (ifm->ifa_index)
		dev = dev_get_by_index(tgt_net, ifm->ifa_index);