Re: [PATCH] reiserfs: fix "new_insert_key’ may be used uninitialized ..."

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, June 6, 2016 1:25:47 PM CEST Jeff Mahoney wrote:
> new_insert_key only makes any sense when it's associated with a
> new_insert_ptr, which is initialized to NULL and changed to a
> buffer_head when we also initialize new_insert_key.  We can key off
> of that to avoid the uninitialized warning.
> 
> Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx>

Thanks a lot for looking into it, that addresses the warning nicely.

	Arnd

> ---
>  fs/reiserfs/ibalance.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/reiserfs/ibalance.c b/fs/reiserfs/ibalance.c
> index b751eea..5db6f45 100644
> --- a/fs/reiserfs/ibalance.c
> +++ b/fs/reiserfs/ibalance.c
> @@ -1153,8 +1153,9 @@ int balance_internal(struct tree_balance *tb,
>                                        insert_ptr);
>         }
>  
> -       memcpy(new_insert_key_addr, &new_insert_key, KEY_SIZE);
>         insert_ptr[0] = new_insert_ptr;
> +       if (new_insert_ptr)
> +               memcpy(new_insert_key_addr, &new_insert_key, KEY_SIZE);
>  
>         return order;
>  }
> 


--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux