From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Shailendra Verma <shailendra.v@samsung.com>
Cc: Cory Tusar <cory.tusar@pid1solutions.com>,
Vladimir Zapolskiy <vz@mleia.com>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Andrew Lunn <andrew@lunn.ch>,
linux-kernel@vger.kernel.org, p.shailesh@samsung.com,
ashish.kalra@samsung.com,
Shailendra Verma <shailendra.capricorn@gmail.com>
Subject: Re: [PATCH] Misc: eeprom - Fix possible NULL derefrence.
Date: Mon, 30 Jan 2017 20:37:57 +0100 [thread overview]
Message-ID: <20170130193757.GC27138@kroah.com> (raw)
In-Reply-To: <1485515551-3191-1-git-send-email-shailendra.v@samsung.com>
On Fri, Jan 27, 2017 at 04:42:31PM +0530, Shailendra Verma wrote:
> of_match_device could return NULL, and so can cause a NULL
> pointer dereference later.
>
> Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
> ---
> drivers/misc/eeprom/eeprom_93xx46.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c
> index 94cc035..6555975 100644
> --- a/drivers/misc/eeprom/eeprom_93xx46.c
> +++ b/drivers/misc/eeprom/eeprom_93xx46.c
> @@ -381,6 +381,11 @@ static int eeprom_93xx46_probe_dt(struct spi_device *spi)
> enum of_gpio_flags of_flags;
> int ret;
>
> + if (!of_id) {
> + dev_err(&spi->dev, "Error: No device match found\n");
> + return -ENODEV;
> + }
> +
Also dropped due to this not being possible.
greg k-h
prev parent reply other threads:[~2017-01-30 19:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170127111239epcas2p41579f86bf18989151d77d7edd39dee9e@epcas2p4.samsung.com>
2017-01-27 11:12 ` [PATCH] Misc: eeprom - Fix possible NULL derefrence Shailendra Verma
2017-01-30 19:37 ` Greg Kroah-Hartman [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=20170130193757.GC27138@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=andrew@lunn.ch \
--cc=ashish.kalra@samsung.com \
--cc=cory.tusar@pid1solutions.com \
--cc=linux-kernel@vger.kernel.org \
--cc=p.shailesh@samsung.com \
--cc=shailendra.capricorn@gmail.com \
--cc=shailendra.v@samsung.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=vz@mleia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.