[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix an uninitialized variable.
From: |
Daniel Kiper |
Subject: |
Re: [PATCH] Fix an uninitialized variable. |
Date: |
Wed, 29 Jan 2020 13:25:48 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Mon, Jan 27, 2020 at 03:01:16PM -0500, Peter Jones wrote:
> gcc says:
>
> grub-core/fs/squash4.c: In function ‘direct_read’:
> grub-core/fs/squash4.c:868:10: error: ‘err’ may be used uninitialized in
> this function [-Werror=maybe-uninitialized]
> 868 | if (err)
> | ^
> cc1: all warnings being treated as errors
>
> This patch initializes it to 0.
>
> Signed-off-by: Peter Jones <address@hidden>
Pushed but with small change...
> ---
> grub-core/fs/squash4.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/grub-core/fs/squash4.c b/grub-core/fs/squash4.c
> index 95d5c1e1ff4..0583aeab8e8 100644
> --- a/grub-core/fs/squash4.c
> +++ b/grub-core/fs/squash4.c
> @@ -746,7 +746,7 @@ direct_read (struct grub_squash_data *data,
> struct grub_squash_cache_inode *ino,
> grub_off_t off, char *buf, grub_size_t len)
> {
> - grub_err_t err;
> + grub_err_t err = 0;
s/0/GRUB_ERR_NONE/
Thanks,
Daniel