From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Aaron Lu <aaron.lu@intel.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
linux-input@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH] input: gpio_keys_polled: Correct check for invalid gpiod
Date: Fri, 19 Feb 2016 12:39:37 +0200 [thread overview]
Message-ID: <20160219103937.GA1770@lahna.fi.intel.com> (raw)
In-Reply-To: <1455876273-5913-1-git-send-email-geert+renesas@glider.be>
On Fri, Feb 19, 2016 at 11:04:33AM +0100, Geert Uytterhoeven wrote:
> At this point in gpio_keys_polled_probe(), button->gpiod contains either
> a pointer to a GPIO descriptor or NULL, because:
> - gpio_keys_polled_get_devtree_pdata() fills in button->gpiod only if
> devm_get_gpiod_from_child() succeeded,
> - gpio_to_desc() returns NULL on failure, not an ERR_PTR(),
> - button->gpiod is untouched if it was NULL, and button->gpio is not
> valid.
>
> Hence check for NULL only, and return -EINVAL on failure.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
next prev parent reply other threads:[~2016-02-19 10:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 10:04 [PATCH] input: gpio_keys_polled: Correct check for invalid gpiod Geert Uytterhoeven
2016-02-19 10:39 ` Mika Westerberg [this message]
2016-02-22 19:54 ` Dmitry Torokhov
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=20160219103937.GA1770@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=aaron.lu@intel.com \
--cc=dmitry.torokhov@gmail.com \
--cc=geert+renesas@glider.be \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).