Skip to contentSkip to conversation

vduse: Fix missing error code in vduse_init()

PATCH New Jiapeng Chong 1 participant 1 message Sep 9, 2021 virtio core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vduse: Fix missing error code in vduse_init()

From: chongjiapeng <[email protected]>

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'.

Eliminate the follow smatch warning:

drivers/vdpa/vdpa_user/vduse_dev.c:1597 vduse_init() warn: missing error code 'ret'.

Fixes c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace")
---
 drivers/vdpa/vdpa_user/vduse_dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/vdpa/vdpa_user/vduse_dev.c +3 -1
index 5c25ff6..6a8878d 100644
@@ -1593,8 +1593,10 @@ static int vduse_init(void)
 
 	vduse_irq_wq = alloc_workqueue("vduse-irq",
 				WQ_HIGHPRI | WQ_SYSFS | WQ_UNBOUND, 0);
-	if (!vduse_irq_wq)
+	if (!vduse_irq_wq) {
+		ret = -EINVAL;
 		goto err_wq;
+	}
 
 	ret = vduse_domain_init();
 	if (ret)
Signature · 1 line
1.8.3.1