]> git.karo-electronics.de Git - karo-tx-linux.git/commit
efi: Fix handling error value in fdt_find_uefi_params
authorAndrzej Hajda <a.hajda@samsung.com>
Tue, 30 Aug 2016 10:41:37 +0000 (12:41 +0200)
committerMatt Fleming <matt@codeblueprint.co.uk>
Mon, 5 Sep 2016 10:26:42 +0000 (11:26 +0100)
commit4af9ed578a50cd331a725322cfd9d555251ce788
tree58acd7dd68f5abcb16310e730afba72a042dc335
parentd4c4fed08f31f3746000c46cb1b20bed2959547a
efi: Fix handling error value in fdt_find_uefi_params

of_get_flat_dt_subnode_by_name can return negative value in case of error.
Assigning the result to unsigned variable and checking if the variable
is lesser than zero is incorrect and always false.
The patch fixes it by using signed variable to check the result.

The problem has been detected using semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
drivers/firmware/efi/efi.c