mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maarten Brock <m.brock@vanmierlo.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Shailendra Verma <shailendra.v@samsung.com>,
	Jiri Slaby <jslaby@suse.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	p.shailesh@samsung.com, ashish.kalra@samsung.com,
	Shailendra Verma <shailendra.capricorn@gmail.com>,
	linux-serial-owner@vger.kernel.org
Subject: Re: [PATCH] Tty: serial - Fix possible NULL derefrence.
Date: Sat, 18 Feb 2017 11:25:19 +0100	[thread overview]
Message-ID: <c5f241d637c1c7208e95683eb50e7aa9@vanmierlo.com> (raw)
In-Reply-To: <20170130193743.GB27138@kroah.com>

Hello Greg,

Does that also mean that this isn't possible in the sc16is7xx.c driver 
in
sc16is7xx_spi_probe() line 1358 and sc16is7xx_i2c_probe() line 1419 ?

If so, should these checks be removed?

Kind regards,
Maarten

On 2017-01-30 20:37, Greg Kroah-Hartman wrote:
> On Fri, Jan 27, 2017 at 04:46:13PM +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/tty/serial/max310x.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/drivers/tty/serial/max310x.c 
>> b/drivers/tty/serial/max310x.c
>> index 8a3e926..a94d147 100644
>> --- a/drivers/tty/serial/max310x.c
>> +++ b/drivers/tty/serial/max310x.c
>> @@ -1323,6 +1323,10 @@ static int max310x_spi_probe(struct spi_device 
>> *spi)
>>  	if (spi->dev.of_node) {
>>  		const struct of_device_id *of_id =
>>  			of_match_device(max310x_dt_ids, &spi->dev);
>> +		if (!of_id) {
>> +			dev_err(&spi->dev, "Error: No device match found\n");
>> +			return -ENODEV;
>> +		}
> 
> Patch now dropped as this isn't possible.
> 
> thanks,
> 
> greg k-h
> --
> To unsubscribe from this list: send the line "unsubscribe linux-serial" 
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-02-18 10:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170127111619epcas4p44c21059f85b7aa091016019c98d42939@epcas4p4.samsung.com>
2017-01-27 11:16 ` Shailendra Verma
2017-01-27 11:31   ` Greg Kroah-Hartman
2017-01-30 19:37   ` Greg Kroah-Hartman
2017-02-18 10:25     ` Maarten Brock [this message]
2017-02-18 13:06       ` Greg Kroah-Hartman

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=c5f241d637c1c7208e95683eb50e7aa9@vanmierlo.com \
    --to=m.brock@vanmierlo.com \
    --cc=ashish.kalra@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial-owner@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=p.shailesh@samsung.com \
    --cc=shailendra.capricorn@gmail.com \
    --cc=shailendra.v@samsung.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

Powered by JetHome