From: Greg KH <gregkh@linuxfoundation.org>
To: Ma Ke <make24@iscas.ac.cn>
Cc: kristo@kernel.org, bp@alien8.de, tony.luck@intel.com,
james.morse@arm.com, mchehab@kernel.org, rric@kernel.org,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2 RESEND] EDAC/ti: Fix possible null pointer dereference in _emif_get_id()
Date: Wed, 24 Jul 2024 15:31:21 +0200 [thread overview]
Message-ID: <2024072407-census-mahogany-5831@gregkh> (raw)
In-Reply-To: <20240724071042.1493917-1-make24@iscas.ac.cn>
On Wed, Jul 24, 2024 at 03:10:42PM +0800, Ma Ke wrote:
> In _emif_get_id(), of_get_address() may return NULL which is later
> dereferenced. Fix this bug by adding NULL check.
>
> Cc: stable@vger.kernel.org
> Fixes: 86a18ee21e5e ("EDAC, ti: Add support for TI keystone and DRA7xx EDAC")
> Signed-off-by: Ma Ke <make24@iscas.ac.cn>
> ---
> Changes in v2:
> - added Cc stable line.
> ---
> drivers/edac/ti_edac.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/edac/ti_edac.c b/drivers/edac/ti_edac.c
> index 29723c9592f7..db23887b2d81 100644
> --- a/drivers/edac/ti_edac.c
> +++ b/drivers/edac/ti_edac.c
> @@ -207,6 +207,9 @@ static int _emif_get_id(struct device_node *node)
> int my_id = 0;
>
> addrp = of_get_address(node, 0, NULL, NULL);
> + if (!addrp)
> + return -EINVAL;
> +
How was this found?
How was this tested?
thanks,
greg k-h
next prev parent reply other threads:[~2024-07-24 13:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 7:10 [PATCH v2 RESEND] EDAC/ti: Fix possible null pointer dereference in _emif_get_id() Ma Ke
2024-07-24 13:31 ` Greg KH [this message]
2024-07-24 17:59 ` Avadhut Naik
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=2024072407-census-mahogany-5831@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=bp@alien8.de \
--cc=james.morse@arm.com \
--cc=kristo@kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=make24@iscas.ac.cn \
--cc=mchehab@kernel.org \
--cc=rric@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tony.luck@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