public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benson Leung <bleung@google.com>
To: egranata@chromium.org
Cc: lee.jones@linaro.org, bleung@chromium.org,
	enric.balletbo@collabora.com, groeck@chromium.org,
	linux-kernel@vger.kernel.org, gwendal@google.com,
	amstan@google.com
Subject: Re: [PATCH] mfd: cros_ec: Only register a positive IRQ number
Date: Fri, 22 Mar 2019 14:15:50 -0700	[thread overview]
Message-ID: <20190322211550.GA139120@google.com> (raw)
In-Reply-To: <20190321210347.34793-1-egranata@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]

Hi Enrico,

On Thu, Mar 21, 2019 at 02:03:47PM -0700, egranata@chromium.org wrote:
> From: Enrico Granata <egranata@chromium.org>
> 
> Add a layer of sanity checking to cros_ec_register against attempting to
> register IRQ values that are not strictly greater than 0.
> 
> Signed-off-by: Enrico Granata <egranata@chromium.org>

Acked-By: Benson Leung <bleung@chromium.org>

> ---
>  drivers/mfd/cros_ec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
> index 6acfe036d5222..ff8984a2b8c21 100644
> --- a/drivers/mfd/cros_ec.c
> +++ b/drivers/mfd/cros_ec.c
> @@ -118,7 +118,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
>  		return err;
>  	}
>  
> -	if (ec_dev->irq) {
> +	if (ec_dev->irq > 0) {
>  		err = devm_request_threaded_irq(dev, ec_dev->irq, NULL,
>  				ec_irq_thread, IRQF_TRIGGER_LOW | IRQF_ONESHOT,
>  				"chromeos-ec", ec_dev);
> -- 
> 2.21.0.225.g810b269d1ac-goog
> 

-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2019-03-22 21:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 21:03 [PATCH] mfd: cros_ec: Only register a positive IRQ number egranata
2019-03-22 19:44 ` Enric Balletbo i Serra
2019-03-22 21:15 ` Benson Leung [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=20190322211550.GA139120@google.com \
    --to=bleung@google.com \
    --cc=amstan@google.com \
    --cc=bleung@chromium.org \
    --cc=egranata@chromium.org \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=gwendal@google.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.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