All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] vhost_task: Fix vhost_task_create return value
@ 2023-03-22 18:56 ` Mike Christie
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Christie @ 2023-03-22 18:56 UTC (permalink / raw)
  To: linux-kernel, virtualization, mst, sgarzare, jasowang, stefanha, brauner
  Cc: syzbot+6b27b2d2aba1c80cc13b

vhost_task_create is supposed to return the vhost_task or NULL on
failure. This fixes it to return the correct value when the allocation
of the struct fails.

Fixes: 77feab3c4156 ("vhost_task: Allow vhost layer to use copy_process") # mainline only
Reported-by: syzbot+6b27b2d2aba1c80cc13b@syzkaller.appspotmail.com
Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 kernel/vhost_task.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/vhost_task.c b/kernel/vhost_task.c
index 4b8aff160640..b7cbd66f889e 100644
--- a/kernel/vhost_task.c
+++ b/kernel/vhost_task.c
@@ -88,7 +88,7 @@ struct vhost_task *vhost_task_create(int (*fn)(void *), void *arg,
 
 	vtsk = kzalloc(sizeof(*vtsk), GFP_KERNEL);
 	if (!vtsk)
-		return ERR_PTR(-ENOMEM);
+		return NULL;
 	init_completion(&vtsk->exited);
 	vtsk->data = arg;
 	vtsk->fn = fn;
-- 
2.25.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-03-25 22:45 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22 18:56 [PATCH 1/1] vhost_task: Fix vhost_task_create return value Mike Christie
2023-03-22 18:56 ` Mike Christie
2023-03-23  7:37 ` Michael S. Tsirkin
2023-03-23  7:37   ` Michael S. Tsirkin
2023-03-23 10:44   ` Christian Brauner
2023-03-23 11:43     ` Michael S. Tsirkin
2023-03-23 11:43       ` Michael S. Tsirkin
2023-03-23 11:50       ` Christian Brauner
2023-03-23 12:47         ` Michael S. Tsirkin
2023-03-23 12:47           ` Michael S. Tsirkin
2023-03-23 15:40           ` Mike Christie
2023-03-23 15:40             ` Mike Christie
2023-03-25 22:45           ` Mike Christie
2023-03-25 22:45             ` Mike Christie
2023-03-23  8:35 ` Stefano Garzarella
2023-03-23  8:35   ` Stefano Garzarella
2023-03-23 10:42 ` Christian Brauner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.