lkml.org 
[lkml]   [2018]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH 1/2] Fix static checker warning
Date
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@oracle.com>
> Reported-by: Dan Carpenter <Dan.Carpenter@oracle.com>
> Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>

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

> ---
> 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);
>

\
 
 \ /
  Last update: 2018-09-19 15:41    [W:0.143 / U:10.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site