Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1213252

[PATCH 1/6] RDS: fix the dangling reference to rds_ib_incoming_slab

From Santosh Shilimkar <santosh.shilimkar@oracle.com>
Newsgroups linux.kernel
Subject [PATCH 1/6] RDS: fix the dangling reference to rds_ib_incoming_slab
Date 2015-08-25 21:10 +0200
Message-ID <q1rLA-77n-23@gated-at.bofh.it> (permalink)
References <q1rLz-77n-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On rds_ib_frag_slab allocation failure, ensure rds_ib_incoming_slab
is not pointing to the detsroyed memory.

Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
---
 net/rds/ib_recv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 3afdcbd..26015eb 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -1102,9 +1102,10 @@ int rds_ib_recv_init(void)
 	rds_ib_frag_slab = kmem_cache_create("rds_ib_frag",
 					sizeof(struct rds_page_frag),
 					0, SLAB_HWCACHE_ALIGN, NULL);
-	if (!rds_ib_frag_slab)
+	if (!rds_ib_frag_slab) {
 		kmem_cache_destroy(rds_ib_incoming_slab);
-	else
+		rds_ib_incoming_slab = NULL;
+	} else
 		ret = 0;
 out:
 	return ret;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] RDS: Few more fixes Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-08-25 21:10 +0200
  [PATCH 6/6] RDS: remove superfluous from rds_ib_alloc_fmr() Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-08-25 21:10 +0200
  [PATCH 1/6] RDS: fix the dangling reference to rds_ib_incoming_slab Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-08-25 21:10 +0200
  [PATCH 3/6] RDS: fix fmr pool dirty_count Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-08-25 21:10 +0200
  [PATCH 2/6] RDS: Fix rds MR reference count in rds_rdma_unuse() Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-08-25 21:10 +0200
  [PATCH 5/6] RDS: flush the FMR pool less often Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-08-25 21:10 +0200
  Re: [PATCH 0/6] RDS: Few more fixes David Miller <davem@davemloft.net> - 2015-08-26 01:30 +0200

csiph-web