Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756068AbbHYTCY (ORCPT ); Tue, 25 Aug 2015 15:02:24 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:47924 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755246AbbHYTCV (ORCPT ); Tue, 25 Aug 2015 15:02:21 -0400 From: Santosh Shilimkar To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, davem@davemloft.net, ssantosh@kernel.org, Santosh Shilimkar Subject: [PATCH 1/6] RDS: fix the dangling reference to rds_ib_incoming_slab Date: Tue, 25 Aug 2015 12:01:58 -0700 Message-Id: <1440529323-4171-2-git-send-email-santosh.shilimkar@oracle.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1440529323-4171-1-git-send-email-santosh.shilimkar@oracle.com> References: <1440529323-4171-1-git-send-email-santosh.shilimkar@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1050 Lines: 34 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 --- 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/