Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1583881
| From | Maarten Brock <m.brock@vanmierlo.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] Tty: serial - Fix possible NULL derefrence. |
| Date | 2017-02-18 12:00 +0100 |
| Message-ID | <tcaUa-PN-1@gated-at.bofh.it> (permalink) |
| References | <t4cJs-3oK-7@gated-at.bofh.it> <t4cJs-3oK-5@gated-at.bofh.it> <t5pXY-7V1-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH] Tty: serial - Fix possible NULL derefrence. Maarten Brock <m.brock@vanmierlo.com> - 2017-02-18 12:00 +0100 Re: [PATCH] Tty: serial - Fix possible NULL derefrence. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-18 14:10 +0100
csiph-web