|
@@ -728,7 +728,12 @@ vhost_scsi_get_tag(struct vhost_virtqueue *vq,
|
|
|
}
|
|
|
se_sess = tv_nexus->tvn_se_sess;
|
|
|
|
|
|
- tag = percpu_ida_alloc(&se_sess->sess_tag_pool, GFP_KERNEL);
|
|
|
+ tag = percpu_ida_alloc(&se_sess->sess_tag_pool, GFP_ATOMIC);
|
|
|
+ if (tag < 0) {
|
|
|
+ pr_err("Unable to obtain tag for tcm_vhost_cmd\n");
|
|
|
+ return ERR_PTR(-ENOMEM);
|
|
|
+ }
|
|
|
+
|
|
|
cmd = &((struct tcm_vhost_cmd *)se_sess->sess_cmd_map)[tag];
|
|
|
sg = cmd->tvc_sgl;
|
|
|
pages = cmd->tvc_upages;
|