From 3f9451bab8645e9b2b23d0d85952bd6fb14cf369 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 4 Nov 2011 18:35:37 +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. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3907 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 cac6e2e79..1c9380c40 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -823,6 +823,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;