if (session->work_pool) mempool_destroy(session->work_pool);
static int session_init(struct tgt_session *session, int max_cmnds){	struct tgt_target *target = session->target;	unsigned long flags;	session->cmnd_pool = mempool_create(max_cmnds, mempool_alloc_slab,					    mempool_free_slab, cmnd_slab);	if (!session->cmnd_pool)		goto out;	session->work_pool = mempool_create(max_cmnds, mempool_alloc_slab,					    mempool_free_slab, work_slab);	if (!session->work_pool)		goto out;	spin_lock_irqsave(&target->lock, flags);	list_add(&session->slist, &target->session_list);	spin_unlock_irqrestore(&target->lock, flags);	return 0;out:	if (session->cmnd_pool)		mempool_destroy(session->cmnd_pool);	if (session->work_pool)		mempool_destroy(session->work_pool);	return -ENOMEM;}