Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba54d3ce authored by santosh.shilimkar@oracle.com's avatar santosh.shilimkar@oracle.com Committed by David S. Miller
Browse files

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: default avatarSantosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b8766e4e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;