diff mbox

[2/2] efi_runtime: fix the uninitialized value rv

Message ID 1474271964-9698-2-git-send-email-ivan.hu@canonical.com
State Accepted
Headers show

Commit Message

Ivan Hu Sept. 19, 2016, 7:59 a.m. UTC
Fix the minor issue found by CoverityScan
520        kfree(name);
CID 1358932 (#1 of 1): Uninitialized scalar variable (UNINIT)17.
uninit_use: Using uninitialized value rv.
521        return rv;
522}

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 efi_runtime/efi_runtime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin Ian King Sept. 19, 2016, 8:14 a.m. UTC | #1
On 19/09/16 08:59, Ivan Hu wrote:
> Fix the minor issue found by CoverityScan
> 520        kfree(name);
> CID 1358932 (#1 of 1): Uninitialized scalar variable (UNINIT)17.
> uninit_use: Using uninitialized value rv.
> 521        return rv;
> 522}
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  efi_runtime/efi_runtime.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c
> index 34f452e..8f5b5fc 100644
> --- a/efi_runtime/efi_runtime.c
> +++ b/efi_runtime/efi_runtime.c
> @@ -443,7 +443,7 @@ static long efi_runtime_get_nextvariablename(unsigned long arg)
>  	efi_guid_t *vd = NULL;
>  	efi_guid_t vendor_guid;
>  	efi_char16_t *name = NULL;
> -	int rv;
> +	int rv = 0;
>  
>  	getnextvariablename_user = (struct efi_getnextvariablename __user *)arg;
>  
> 
Thanks Ivan,

Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung Sept. 19, 2016, 9:02 p.m. UTC | #2
On 2016-09-19 12:59 AM, Ivan Hu wrote:
> Fix the minor issue found by CoverityScan
> 520        kfree(name);
> CID 1358932 (#1 of 1): Uninitialized scalar variable (UNINIT)17.
> uninit_use: Using uninitialized value rv.
> 521        return rv;
> 522}
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  efi_runtime/efi_runtime.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c
> index 34f452e..8f5b5fc 100644
> --- a/efi_runtime/efi_runtime.c
> +++ b/efi_runtime/efi_runtime.c
> @@ -443,7 +443,7 @@ static long efi_runtime_get_nextvariablename(unsigned long arg)
>  	efi_guid_t *vd = NULL;
>  	efi_guid_t vendor_guid;
>  	efi_char16_t *name = NULL;
> -	int rv;
> +	int rv = 0;
>
>  	getnextvariablename_user = (struct efi_getnextvariablename __user *)arg;
>
>

Acked-by: Alex Hung <alex.hung@canonical.com>
diff mbox

Patch

diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c
index 34f452e..8f5b5fc 100644
--- a/efi_runtime/efi_runtime.c
+++ b/efi_runtime/efi_runtime.c
@@ -443,7 +443,7 @@  static long efi_runtime_get_nextvariablename(unsigned long arg)
 	efi_guid_t *vd = NULL;
 	efi_guid_t vendor_guid;
 	efi_char16_t *name = NULL;
-	int rv;
+	int rv = 0;
 
 	getnextvariablename_user = (struct efi_getnextvariablename __user *)arg;