[Skiboot] [PATCH 1/2] libflash: check ffs_part_info return value in ffs_init

Stewart Smith stewart at linux.vnet.ibm.com
Mon Aug 17 23:11:39 AEST 2015


Jeremy Kerr <jk at ozlabs.org> writes:
> Current packaging builds (which specify -O2) fail for me, with:
>
>      CC  libffs.o
>  ../../libflash/libffs.c: In function ffs_init:
>  ../../libflash/libffs.c:149:8: error: start may be used uninitialized in this function [-Werror=maybe-uninitialized]
>       rc = blocklevel_ecc_protect(bl, start, total_size);
>          ^
>  ../../libflash/libffs.c:149:8: error: total_size may be used uninitialized in this function [-Werror=maybe-uninitialized]
>  ../../libflash/libffs.c:148:7: error: ecc may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      if (ecc) {
>         ^
>  cc1: all warnings being treated as errors
>
> This is because we're not checking for the return value of
> ffs_part_info, which may return with start/total_size/ecc uninitialised.
>
> Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

Merged. Although the mail was pretty mangled, had to use patch rather
than "git am -s"



More information about the Skiboot mailing list