Commit 2d6eac6c authored by Adrian Bunk's avatar Adrian Bunk Committed by Greg Kroah-Hartman

[PATCH] drivers/infiniband/core/mad.c: fix a use-after-free

The Coverity checker spotted this obvious use-after-free
caused by a wrong order of the cleanups.
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Acked-by: default avatarRoland Dreier <rolandd@cisco.com>
Signed-off-by: default avatarChris Wright <chrisw@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d2b0e84d
......@@ -356,9 +356,9 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
spin_unlock_irqrestore(&port_priv->reg_lock, flags);
kfree(reg_req);
error3:
kfree(mad_agent_priv);
error2:
ib_dereg_mr(mad_agent_priv->agent.mr);
error2:
kfree(mad_agent_priv);
error1:
return ret;
}
......
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