summaryrefslogtreecommitdiff
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2013-01-14 19:34:09 (GMT)
committerJiri Kosina <jkosina@suse.cz>2013-01-29 09:52:20 (GMT)
commitfe194f19da971a114b0f65cf8267c1d42f3be87e (patch)
treeea48f2a6298864c3b8989b1d13ca0eab1fdb844f /drivers/infiniband
parentc353516f48b5496e3d806782cd900763133707c5 (diff)
downloadlinux-fsl-qoriq-fe194f19da971a114b0f65cf8267c1d42f3be87e.tar.xz
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: Jesper Juhl <jj@chaosbits.net> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_provider.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index 0bdf09a..145d82a 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -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;
}