From cb0f454f73cc85019b0b844e3fd66caa2d219d5c Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Mon, 18 Feb 2019 17:48:53 +0100 Subject: [PATCH] pylibfdt: check_err accepts only integer as a first argument. A list passed as an argument to check_err() means that there is no error code to check and therefore it should be returned back. Signed-off-by: Lumir Balhar Message-Id: <20190218164856.23861-2-frenzy@frenzy.cz> Signed-off-by: David Gibson --- pylibfdt/libfdt.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i index 6f1f1dc..084bc5b 100644 --- a/pylibfdt/libfdt.i +++ b/pylibfdt/libfdt.i @@ -137,7 +137,7 @@ def check_err(val, quiet=()): Raises FdtException if val < 0 """ - if val < 0: + if isinstance(val, int) and val < 0: if -val not in quiet: raise FdtException(val) return val