Commit 960657b7 authored by Pan Bian's avatar Pan Bian Committed by Jason Gunthorpe

RDMA/qedr: Fix potential use after free

Move the release operation after error log to avoid possible use after
free.

Link: https://lore.kernel.org/r/1573021434-18768-1-git-send-email-bianpan2016@163.comSigned-off-by: default avatarPan Bian <bianpan2016@163.com>
Acked-by: Michal Kalderon <michal.kalderon@marvell.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent e88982ad
...@@ -481,10 +481,10 @@ qedr_addr6_resolve(struct qedr_dev *dev, ...@@ -481,10 +481,10 @@ qedr_addr6_resolve(struct qedr_dev *dev,
if ((!dst) || dst->error) { if ((!dst) || dst->error) {
if (dst) { if (dst) {
dst_release(dst);
DP_ERR(dev, DP_ERR(dev,
"ip6_route_output returned dst->error = %d\n", "ip6_route_output returned dst->error = %d\n",
dst->error); dst->error);
dst_release(dst);
} }
return -EINVAL; return -EINVAL;
} }
......
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