Commit 802aea6a authored by Pan Bian's avatar Pan Bian Committed by Greg Kroah-Hartman

RDMA/i40iw: Fix potential use after free

[ Upstream commit da046d5f ]

Release variable dst after logging dst->error to avoid possible use after
free.

Link: https://lore.kernel.org/r/1573022651-37171-1-git-send-email-bianpan2016@163.comSigned-off-by: default avatarPan Bian <bianpan2016@163.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent fa12d56b
...@@ -2036,9 +2036,9 @@ static int i40iw_addr_resolve_neigh_ipv6(struct i40iw_device *iwdev, ...@@ -2036,9 +2036,9 @@ static int i40iw_addr_resolve_neigh_ipv6(struct i40iw_device *iwdev,
dst = i40iw_get_dst_ipv6(&src_addr, &dst_addr); dst = i40iw_get_dst_ipv6(&src_addr, &dst_addr);
if (!dst || dst->error) { if (!dst || dst->error) {
if (dst) { if (dst) {
dst_release(dst);
i40iw_pr_err("ip6_route_output returned dst->error = %d\n", i40iw_pr_err("ip6_route_output returned dst->error = %d\n",
dst->error); dst->error);
dst_release(dst);
} }
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment