rivafb: Fix i2c error handling
PATCH 4/10 rivafb: Fix i2c error handling
Fixed error handling in rivafb-i2c.c if bus registration fails.
Signed-off-by Antonino Daplas <[email protected]>
---
rivafb-i2c.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
drivers/video/riva/rivafb-i2c.c +9 -2
@@ -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