The "ret" variable could be uninitialized on the success path depending
on if "is_async" is true of false.  Initialized it to zero.

Fixes: f5288d14069b ("Drivers: hv: Introduce mshv_root module to expose 
/dev/mshv to VMMs")
Signed-off-by: Dan Carpenter <dan.carpen...@linaro.org>
---
 drivers/hv/mshv_root_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c
index 29fa6d5a3994..b94d8fe0f691 100644
--- a/drivers/hv/mshv_root_main.c
+++ b/drivers/hv/mshv_root_main.c
@@ -151,13 +151,14 @@ static int mshv_ioctl_passthru_hvcall(struct 
mshv_partition *partition,
                                      void __user *user_args)
 {
        u64 status;
-       int ret, i;
        bool is_async;
        struct mshv_root_hvcall args;
        struct page *page;
        unsigned int pages_order;
        void *input_pg = NULL;
        void *output_pg = NULL;
+       int ret = 0;
+       int i;
 
        if (copy_from_user(&args, user_args, sizeof(args)))
                return -EFAULT;
-- 
2.47.2


Reply via email to