diff options
author | Keith Busch <kbusch@kernel.org> | 2025-02-27 15:06:30 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-03-01 02:52:52 -0500 |
commit | cb380909ae3b1ebf14d6a455a4f92d7916d790cb (patch) | |
tree | dd3d246e73d00711c6c1ed0fc6a2cce1a73c6c6d /kernel/vhost_task.c | |
parent | 982caaa1150479f022003390cd72a1941663d211 (diff) |
vhost: return task creation error instead of NULL
Lets callers distinguish why the vhost task creation failed. No one
currently cares why it failed, so no real runtime change from this
patch, but that will not be the case for long.
Signed-off-by: Keith Busch <kbusch@kernel.org>
Message-ID: <20250227230631.303431-2-kbusch@meta.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'kernel/vhost_task.c')
-rw-r--r-- | kernel/vhost_task.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/vhost_task.c b/kernel/vhost_task.c index 8800f5acc007..2ef2e1b80091 100644 --- a/kernel/vhost_task.c +++ b/kernel/vhost_task.c @@ -133,7 +133,7 @@ struct vhost_task *vhost_task_create(bool (*fn)(void *), vtsk = kzalloc(sizeof(*vtsk), GFP_KERNEL); if (!vtsk) - return NULL; + return ERR_PTR(-ENOMEM); init_completion(&vtsk->exited); mutex_init(&vtsk->exit_mutex); vtsk->data = arg; @@ -145,7 +145,7 @@ struct vhost_task *vhost_task_create(bool (*fn)(void *), tsk = copy_process(NULL, 0, NUMA_NO_NODE, &args); if (IS_ERR(tsk)) { kfree(vtsk); - return NULL; + return ERR_PTR(PTR_ERR(tsk)); } vtsk->task = tsk; |