提交 fe194f19 编写于 作者: J Jesper Juhl 提交者: Jiri Kosina

IB: cxgb3: delay freeing mem untill entirely done with it

Sure, it's just the pointer value we use, but the coverity checker
complains about a use-after-free bug and it really does seem cleaner
to delay freeing until we are entirely done with the memory. So,
rearrange the code to move the kfree() later untill we are completely
done.
Trivial and harmless, but nice IMHO.
Signed-off-by: NJesper Juhl <jj@chaosbits.net>
Reviewed-by: NSteve Wise <swise@opengridcomputing.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 c353516f
......@@ -783,8 +783,8 @@ static int iwch_dealloc_mw(struct ib_mw *mw)
mmid = (mw->rkey) >> 8;
cxio_deallocate_window(&rhp->rdev, mhp->attr.stag);
remove_handle(rhp, &rhp->mmidr, mmid);
kfree(mhp);
PDBG("%s ib_mw %p mmid 0x%x ptr %p\n", __func__, mw, mmid, mhp);
kfree(mhp);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册