* [RFC, 2.6.26.3-rc1] i2c: Fix NULL pointer dereference in i2c_new_probed_device
@ 2008-08-11 20:07 Oliver Pinter
2008-08-11 20:45 ` Jean Delvare
0 siblings, 1 reply; 2+ messages in thread
From: Oliver Pinter @ 2008-08-11 20:07 UTC (permalink / raw)
To: linux-kernel; +Cc: Hans Verkuil, Jean Delvare, Oliver Pinter
>From b25b791b13aaa336b56c4f9bd417ff126363f80b Mon Sep 17 00:00:00 2001
It is an RFC for sending this patch for stable, when this patch needed, then send ACK and CC stable,
if not then send NAK.
---
From: Hans Verkuil <hverkuil@xs4all.nl>
Date: Sun, 10 Aug 2008 22:56:15 +0200
Subject: [PATCH] i2c: Fix NULL pointer dereference in i2c_new_probed_device
Fix a NULL pointer dereference that happened when calling
i2c_new_probed_device on one of the addresses for which we use byte
reads instead of quick write for detection purpose (that is: 0x30-0x37
and 0x50-0x5f).
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
CC: Oliver Pinter <oliver.pntr@gmail.com>
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 7bf38c4..c16dcad 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1451,9 +1451,11 @@ i2c_new_probed_device(struct i2c_adapter *adap,
if ((addr_list[i] & ~0x07) == 0x30
|| (addr_list[i] & ~0x0f) == 0x50
|| !i2c_check_functionality(adap, I2C_FUNC_SMBUS_QUICK)) {
+ union i2c_smbus_data data;
+
if (i2c_smbus_xfer(adap, addr_list[i], 0,
I2C_SMBUS_READ, 0,
- I2C_SMBUS_BYTE, NULL) >= 0)
+ I2C_SMBUS_BYTE, &data) >= 0)
break;
} else {
if (i2c_smbus_xfer(adap, addr_list[i], 0,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC, 2.6.26.3-rc1] i2c: Fix NULL pointer dereference in i2c_new_probed_device
2008-08-11 20:07 [RFC, 2.6.26.3-rc1] i2c: Fix NULL pointer dereference in i2c_new_probed_device Oliver Pinter
@ 2008-08-11 20:45 ` Jean Delvare
0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2008-08-11 20:45 UTC (permalink / raw)
To: Oliver Pinter; +Cc: linux-kernel, Hans Verkuil
On Mon, 11 Aug 2008 22:07:53 +0200, Oliver Pinter wrote:
>
> From b25b791b13aaa336b56c4f9bd417ff126363f80b Mon Sep 17 00:00:00 2001
I doubt it...
> It is an RFC for sending this patch for stable, when this patch needed, then send ACK and CC stable,
> if not then send NAK.
And what exactly is stable going to do with a patch they can't even
apply due to the quotation marks my e-mail client will have added?
Doesn't make sense to me. I can send my patches to stable myself, thank
you. And without spamming LKML at that.
>
> ---
>
> From: Hans Verkuil <hverkuil@xs4all.nl>
> Date: Sun, 10 Aug 2008 22:56:15 +0200
> Subject: [PATCH] i2c: Fix NULL pointer dereference in i2c_new_probed_device
>
> Fix a NULL pointer dereference that happened when calling
> i2c_new_probed_device on one of the addresses for which we use byte
> reads instead of quick write for detection purpose (that is: 0x30-0x37
> and 0x50-0x5f).
>
> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> CC: Oliver Pinter <oliver.pntr@gmail.com>
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 7bf38c4..c16dcad 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1451,9 +1451,11 @@ i2c_new_probed_device(struct i2c_adapter *adap,
> if ((addr_list[i] & ~0x07) == 0x30
> || (addr_list[i] & ~0x0f) == 0x50
> || !i2c_check_functionality(adap, I2C_FUNC_SMBUS_QUICK)) {
> + union i2c_smbus_data data;
> +
> if (i2c_smbus_xfer(adap, addr_list[i], 0,
> I2C_SMBUS_READ, 0,
> - I2C_SMBUS_BYTE, NULL) >= 0)
> + I2C_SMBUS_BYTE, &data) >= 0)
> break;
> } else {
> if (i2c_smbus_xfer(adap, addr_list[i], 0,
>
--
Jean Delvare
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-11 20:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-11 20:07 [RFC, 2.6.26.3-rc1] i2c: Fix NULL pointer dereference in i2c_new_probed_device Oliver Pinter
2008-08-11 20:45 ` Jean Delvare
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®