u-boot/tools
Thomas Huth 310ae37edb Fix bad return value checks (detected with Coccinelle)
In the "Getting Started with Coccinelle - KVM edition" presentation that
has been held by Julia Lawall at the KVM forum 2015 (see the slides at
http://events.linuxfoundation.org/sites/events/files/slides/tutorial_kvm_0.pdf),
she pointed out some bad return value checks in U-Boot that can be
detected with Coccinelle by using the following config file:

@@
identifier x,y;
identifier f;
statement S;
@@
x = f(...);
(
 if (x < 0) S
|
 if (
-     y
+     x
 < 0) S
)

This patch now fixes these issues.

Signed-off-by: Thomas Huth <huth@tuxfamily.org>
2015-10-24 13:50:30 -04:00
..
buildman buildman: Improve the config comparison feature 2015-09-09 07:48:03 -06:00
easylogo tools: convert makefiles to kbuild style 2014-02-19 11:07:49 -05:00
env tools/env/fw_env.h: Correct include order 2015-06-18 16:11:42 -04:00
gdb Makefile: move BFD_ROOT_DIR to tools/gdb/Makefile 2014-02-19 11:07:50 -05:00
kermit tools: move kermit files to tools/kermit directory 2014-01-24 16:59:07 -05:00
logos logos: add Toradex logo 2015-08-13 07:19:37 -04:00
omap
palmtreo680
patman Revert "patman: use -D option for git format-patch" 2015-09-09 07:48:03 -06:00
scripts kbuild: move asm-offsets.h rules to ./Kbuild 2014-02-25 11:01:28 -05:00
.gitignore gitignore: Add defconfig and fdtgrep 2015-08-05 08:42:39 -06:00
aisimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
aisimage.h
atmel_pmecc_params.c arm:at91: enable ROM loadable atmel image 2014-05-27 00:10:49 +02:00
atmelimage.c tools/atmelimage.c: Fix warning when debug is enabled 2015-08-28 14:01:11 -04:00
bin2header.c
bmp_logo.c
default_image.c Fix variation in timestamps caused by timezone differences. 2015-10-11 17:12:12 -04:00
dumpimage.c dumpimage: replace the term "datafile" by "subimage" 2015-01-29 13:38:41 -05:00
dumpimage.h includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
envcrc.c
fdt_host.h tools, fit_check_sign: verify a signed fit image 2014-03-21 16:40:38 -04:00
fdtgrep.c fdt: Add fdtgrep tool 2015-07-21 17:39:20 -06:00
fit_check_sign.c Fix bad return value checks (detected with Coccinelle) 2015-10-24 13:50:30 -04:00
fit_common.c mkimage: Automatically make space in FDT when full 2014-06-11 16:25:46 -04:00
fit_common.h mkimage: Automatically make space in FDT when full 2014-06-11 16:25:46 -04:00
fit_image.c dumpimage: fit: extract FIT images 2015-01-29 13:38:41 -05:00
fit_info.c tools, fit_info: increase buffer for command name 2014-08-14 11:20:24 +02:00
gen_eth_addr.c tools: gen_eth_addr: add getpid() to time(0) to avoid duplicated seed 2015-09-28 10:48:25 -04:00
genboardscfg.py tools/genboardscfg.py: pick up also commented maitainers 2014-09-24 18:30:28 -04:00
getline.c
getline.h
gpheader.h tools: mkimage: add support for gpimage format 2014-04-17 17:24:38 -04:00
gpimage-common.c dumpimage: add 'T' option to explicitly set the image type 2015-01-29 13:38:41 -05:00
gpimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
ifdtool.c x86: ifdtool: Support checking region overlap before U-Boot 2015-09-09 07:48:03 -06:00
ifdtool.h tools/ifdtool: Support writing multiple files (-w) simultaneously 2014-12-13 22:32:04 -07:00
image-host.c tools: fix typo in tools/image-host.c 2014-08-14 11:20:01 +02:00
imagetool.c tools/imagetool: remove linker script 2015-02-16 12:41:41 -05:00
imagetool.h mkimage: Allow the original file size to be recorded 2015-09-02 21:28:23 -06:00
img2brec.sh
img2srec.c
imximage.c imximage: fix commands other than write_data 2015-10-07 13:43:15 +02:00
imximage.h imximage: fix commands other than write_data 2015-10-07 13:43:15 +02:00
jtagconsole
kwbimage.c kwbimage: Align payload size to 4 bytes 2015-10-21 02:25:01 +02:00
kwbimage.h tools: kwboot: Add support for UART boot mode patching for Armada XP/38x 2015-10-01 02:02:06 +02:00
kwboot.c tools: kwboot: Add support for UART boot mode patching for Armada XP/38x 2015-10-01 02:02:06 +02:00
lpc32xximage.c lpc32xx: add lpc32xx-spl.bin boot image target 2015-04-10 14:23:26 +02:00
Makefile rockchip: Add support for the SD image 2015-09-02 21:28:23 -06:00
microcode-tool x86: Add a script to process Intel microcode files 2014-12-18 17:26:08 -07:00
microcode-tool.py x86: Enhance the microcode tool to support header files as input 2015-02-05 22:16:42 -07:00
mingw_support.c
mingw_support.h
mkenvimage.c Patch to mkenvimage to handle text files with length that exceed env size 2015-03-28 12:07:47 -04:00
mkexynosspl.c Fix bad return value checks (detected with Coccinelle) 2015-10-24 13:50:30 -04:00
mkimage.c tools/mkimage.c: Clarify help text for -D slightly 2015-10-11 17:12:11 -04:00
mkimage.h includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
mksunxiboot.c sunxi: (mksunxiboot) signature to indicate "sunxi" SPL variant 2015-09-29 11:50:07 +02:00
moveconfig.py tools: moveconfig: Update the URL for nds32 toolchain 2015-09-28 11:03:55 -04:00
mxsboot.c mxs: mxsboot: fix endianess for sd boot images 2015-09-13 10:19:40 +02:00
mxsimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
mxsimage.h ARM: mxs: tools: Add support for boot progress display flag 2014-11-20 10:13:45 +01:00
ncb.c
netconsole
omapimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
omapimage.h tools: mkimage: add support for gpimage format 2014-04-17 17:24:38 -04:00
os_support.c
os_support.h
pbl_crc32.c mkimage : Split out and clean pbl_crc32 for use by other image types 2014-06-05 14:38:38 -04:00
pbl_crc32.h mkimage : Split out and clean pbl_crc32 for use by other image types 2014-06-05 14:38:38 -04:00
pblimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
pblimage.h
proftool.c Fix musl build 2015-05-08 17:24:17 -04:00
relocate-rela.c relocate-rela: replace a magic number with sizeof(Elf64_Rela) 2014-02-13 15:16:47 +01:00
rkcommon.c rockchip: Add the rkimage format to mkimage 2015-09-02 21:28:23 -06:00
rkcommon.h rockchip: Add the rkimage format to mkimage 2015-09-02 21:28:23 -06:00
rkimage.c rockchip: Add the rkimage format to mkimage 2015-09-02 21:28:23 -06:00
rksd.c rockchip: Drop first 32kb of zeros from the rkSD image type 2015-09-02 21:28:25 -06:00
rkspi.c rockchip: Add support for the SPI image 2015-09-02 21:28:23 -06:00
socfpgaimage.c tools: do not print error messages in verify_header() functions 2015-01-29 13:38:41 -05:00
ublimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
ublimage.h
ubsha1.c includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
xway-swap-bytes.c