public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Andrzej Hajda <a.hajda@samsung.com>
Cc: "open list:EXTENSIBLE FIRMWARE INTERFACE (EFI)" 
	<linux-efi@vger.kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	open list <linux-kernel@vger.kernel.org>,
	Shannon Zhao <shannon.zhao@linaro.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	Mark Salter <msalter@redhat.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH] efi: fix handling error value in fdt_find_uefi_params
Date: Fri, 19 Aug 2016 13:30:26 +0100	[thread overview]
Message-ID: <20160819123026.GV30909@codeblueprint.co.uk> (raw)
In-Reply-To: <1471428040-23463-1-git-send-email-a.hajda@samsung.com>

On Wed, 17 Aug, at 12:00:40PM, Andrzej Hajda wrote:
> of_get_flat_dt_subnode_by_name can return negative value in case of error.
> 
> 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>
> ---
>  drivers/firmware/efi/efi.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 5a2631a..7dd2e2d 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -657,9 +657,12 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname,
>  		}
>  
>  		if (subnode) {
> -			node = of_get_flat_dt_subnode_by_name(node, subnode);
> -			if (node < 0)
> +			int err = of_get_flat_dt_subnode_by_name(node, subnode);
> +
> +			if (err < 0)
>  				return 0;
> +
> +			node = err;
>  		}
>  
>  		return __find_uefi_params(node, info, dt_params[i].params);
> -- 
> 1.9.1
 
Looks good to me. Thanks, applied.

      reply	other threads:[~2016-08-19 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 10:00 [PATCH] efi: fix handling error value in fdt_find_uefi_params Andrzej Hajda
2016-08-19 12:30 ` Matt Fleming [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160819123026.GV30909@codeblueprint.co.uk \
    --to=matt@codeblueprint.co.uk \
    --cc=a.hajda@samsung.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=leif.lindholm@linaro.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=msalter@redhat.com \
    --cc=shannon.zhao@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox