From fe6c9a0a3219d8e3b7c5583d21e49e612f042540 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 4 Nov 2011 18:38:01 +0000 Subject: [PATCH] ib_srpt: Make srpt_alloc_ioctx_ring() return NULL instead of a dangling pointer if allocation fails. Reported by Dan Carpenter on the linux-rdma@vger.kernel.org mailing list. (Merged r3907 from the trunk.) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.1.0.x@3908 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 22520d1b8..9f7dff047 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -825,6 +825,7 @@ err: while (--i >= 0) srpt_free_ioctx(sdev, ring[i], dma_size, dir); kfree(ring); + ring = NULL; out: TRACE_EXIT_HRES(ring); return ring;