Re: Re: 2.6.11-rc5, rivafb i2c oops, bogus error handling
flat view
From: Antonino A. Daplas <hidden>
Date: 2005-02-28 14:42:41
Also in:
lkml
On Monday 28 February 2005 04:32, Olaf Hering wrote:
On Wed, Feb 23, Linus Torvalds wrote:quoted
This time it's really supposed to be a quickie, so people who can, please check it out, and we'll make the real 2.6.11 asap.Here is another one, probably not new. Is riva_get_EDID_i2c a bit too optimistic by not having a $i2cadapter_ok member in riva_par->riva_i2c_chan? It calls riva_probe_i2c_connector even if riva_create_i2c_busses fails to register all 3 busses.
Thanks, Can you try this? Fixed error handling in rivafb-i2c.c if bus registration fails. Signed-off-by: Antonino Daplas <redacted> --- rivafb-i2c.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff -Nru a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c
--- a/drivers/video/riva/rivafb-i2c.c 2005-01-13 03:57:12 +08:00
+++ b/drivers/video/riva/rivafb-i2c.c 2005-02-28 08:22:06 +08:00@@ -120,8 +120,12 @@ rc = i2c_bit_add_bus(&chan->adapter); if (rc == 0) dev_dbg(&chan->par->pdev->dev, "I2C bus %s registered.\n", name); - else - dev_warn(&chan->par->pdev->dev, "Failed to register I2C bus %s.\n", name); + else { + dev_warn(&chan->par->pdev->dev, + "Failed to register I2C bus %s.\n", name); + chan->par = NULL; + } + return rc; }
@@ -171,6 +175,9 @@ }, }; u8 *buf; + + if (!chan->par) + return NULL; buf = kmalloc(EDID_LENGTH, GFP_KERNEL); if (!buf) { -------------------------------------------------------
SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click