/* Returns a fully allocated command (with the allied sense buffer) or NULL on failure  */
static struct scsi_cmnd* scsi_pool_alloc_command(struct scsi_host_cmd_pool *pool, gfp_t gfp_mask)
/* Returns a fully allocated command (with the allied sense buffer) or NULL on failure  */
static struct scsi_cmnd* scsi_pool_alloc_command(struct scsi_host_cmd_pool *pool, gfp_t gfp_mask)
{
	struct scsi_cmnd *cmd;
	cmd = kmem_cache_zalloc(pool->cmd_slab, gfp_mask | pool->gfp_mask);
	if (!cmd)
		return NULL;
	cmd->sense_buffer = kmem_cache_alloc(pool->sense_slab,
					     gfp_mask | pool->gfp_mask);
	if (!cmd->sense_buffer) {
		kmem_cache_free(pool->cmd_slab, cmd);
		return NULL;
	}
	return cmd;
}