* [PATCH 4/10] rivafb: Fix i2c error handling
@ 2005-03-06 0:16 Antonino A. Daplas
0 siblings, 0 replies; only message in thread
From: Antonino A. Daplas @ 2005-03-06 0:16 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Fbdev development list
Fixed error handling in rivafb-i2c.c if bus registration fails.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
---
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-12 06:10:17 +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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-03-06 0:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-06 0:16 [PATCH 4/10] rivafb: Fix i2c error handling Antonino A. Daplas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).