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:
santosh.shilimkar@oracle.com 2015-08-25 12:01:58 -07:00 коммит произвёл David S. Miller
Родитель b8766e4ed3
Коммит ba54d3ced9
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -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;