lkml.org 
[lkml]   [2019]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] KVM: SVM: Fix "error" isn't initialized
Date
> From e7f9c786e43ef4f890b8a01f15f8f00786f4b14a Mon Sep 17 00:00:00 2001
> From: Haiwei Li <lihaiwei@tencent.com>
> Date: Wed, 27 Nov 2019 15:00:49 +0800
> Subject: [PATCH v2] fix: 'error' is not initialized
>
> There are a bunch of error paths were "error" isn't initialized.
> @@ -155,6 +155,8 @@ static int __sev_do_cmd_locked(int cmd, void *data, int *psp_ret)
> unsigned int phys_lsb, phys_msb;
> unsigned int reg, ret = 0;
>
> + *psp_ret = -1;
> +
> if (!psp)
> return -ENODEV;
>

The arg psp_ret may be NULL in some path such as sev_guest_df_flush(NULL).
So you have to check it against NULL.
Thanks.
\
 
 \ /
  Last update: 2019-11-27 09:48    [W:0.040 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site