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 <ssantosh@kernel.org> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b8766e4ed3
commit
ba54d3ced9
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue