* [PATCH] IB: cxgb3: delay freeing mem untill entirely done with it
@ 2013-01-14 19:34 Jesper Juhl
2013-01-14 21:43 ` Steve Wise
0 siblings, 1 reply; 3+ messages in thread
From: Jesper Juhl @ 2013-01-14 19:34 UTC (permalink / raw)
To: linux-kernel
Cc: linux-rdma, Hal Rosenstock, Sean Hefty, Roland Dreier, Steve Wise,
trivial
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>
---
drivers/infiniband/hw/cxgb3/iwch_provider.c | 2 +-
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;
}
--
1.7.1
--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] IB: cxgb3: delay freeing mem untill entirely done with it
2013-01-14 19:34 [PATCH] IB: cxgb3: delay freeing mem untill entirely done with it Jesper Juhl
@ 2013-01-14 21:43 ` Steve Wise
2013-01-29 9:52 ` Jiri Kosina
0 siblings, 1 reply; 3+ messages in thread
From: Steve Wise @ 2013-01-14 21:43 UTC (permalink / raw)
To: Jesper Juhl
Cc: linux-kernel, linux-rdma, Hal Rosenstock, Sean Hefty,
Roland Dreier, Steve Wise, trivial
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] IB: cxgb3: delay freeing mem untill entirely done with it
2013-01-14 21:43 ` Steve Wise
@ 2013-01-29 9:52 ` Jiri Kosina
0 siblings, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2013-01-29 9:52 UTC (permalink / raw)
To: Steve Wise
Cc: Jesper Juhl, linux-kernel, linux-rdma, Hal Rosenstock, Sean Hefty,
Roland Dreier, Steve Wise
On Mon, 14 Jan 2013, Steve Wise wrote:
> Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-29 9:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-14 19:34 [PATCH] IB: cxgb3: delay freeing mem untill entirely done with it Jesper Juhl
2013-01-14 21:43 ` Steve Wise
2013-01-29 9:52 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox