mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: intel-lpss: Add missing check for platform_get_resource
Date: Thu, 8 Jun 2023 18:14:29 +0100	[thread overview]
Message-ID: <20230608171429.GF3572061@google.com> (raw)
In-Reply-To: <20230531100257.17769-1-jiasheng@iscas.ac.cn>

On Wed, 31 May 2023, Jiasheng Jiang wrote:

> Add the missing check for platform_get_resource and return error
> if it fails.
> 
> Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
>  drivers/mfd/intel-lpss-acpi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c
> index a143c8dca2d9..1a6ebd3d9795 100644
> --- a/drivers/mfd/intel-lpss-acpi.c
> +++ b/drivers/mfd/intel-lpss-acpi.c
> @@ -183,6 +183,9 @@ static int intel_lpss_acpi_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	info->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!info->mem)
> +		return -ENOMEM;

This does not mean we're out of memory.

Please use either -EINVAL or -ENODEV.

> +
>  	info->irq = platform_get_irq(pdev, 0);
>  
>  	ret = intel_lpss_probe(&pdev->dev, info);
> -- 
> 2.25.1
> 

-- 
Lee Jones [李琼斯]

      reply	other threads:[~2023-06-08 17:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 10:02 Jiasheng Jiang
2023-06-08 17:14 ` Lee Jones [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=20230608171429.GF3572061@google.com \
    --to=lee@kernel.org \
    --cc=jiasheng@iscas.ac.cn \
    --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

all inboxes | Powered by JetHome®