From: santosh.shilimkar@oracle.com Date: Tue, 25 Aug 2015 19:01:58 +0000 (-0700) Subject: RDS: fix the dangling reference to rds_ib_incoming_slab X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ba54d3ced958435e1802daf992cfd44c26cd4cb7;p=linux-beck.git RDS: fix the dangling reference to rds_ib_incoming_slab On rds_ib_frag_slab allocation failure, ensure rds_ib_incoming_slab is not pointing to the detsroyed memory. Signed-off-by: Santosh Shilimkar Signed-off-by: Santosh Shilimkar Signed-off-by: David S. Miller --- diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index ed9b41e3b277..6bbe62060060 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;