Re: [PATCH 1/2] Fix static checker warning

From: Gary R Hook
Date: Wed Sep 19 2018 - 09:41:00 EST


On 09/14/2018 05:32 PM, Janakarajan Natarajan wrote:
> Under certain configuration SEV functions can be defined as no-op.
> In such a case error can be uninitialized.
>
> Initialize the variable to 0.
>
> Cc: Dan Carpenter <Dan.Carpenter@xxxxxxxxxx>
> Reported-by: Dan Carpenter <Dan.Carpenter@xxxxxxxxxx>
> Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@xxxxxxx>

Acked-by: Gary R Hook <gary.hook@xxxxxxx>

> ---
> drivers/crypto/ccp/psp-dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c
> index 72790d8..f541e60 100644
> --- a/drivers/crypto/ccp/psp-dev.c
> +++ b/drivers/crypto/ccp/psp-dev.c
> @@ -423,7 +423,7 @@ EXPORT_SYMBOL_GPL(psp_copy_user_blob);
> static int sev_get_api_version(void)
> {
> struct sev_user_data_status *status;
> - int error, ret;
> + int error = 0, ret;
>
> status = &psp_master->status_cmd_buf;
> ret = sev_platform_status(status, &error);
>