Thread (3 messages) flat view 3 messages, 2 authors, 2005-03-09
STALE7858d

[PATCH 5/10] nvidiafb: Fix i2c error handling

From: Antonino A. Daplas <hidden>
Date: 2005-03-06 00:18:59

  Fixed error handling in rivafb-i2c.c if bus registration fails.

Signed-off-by: Antonino Daplas <redacted>
---

 nv_i2c.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff -Nru a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c
--- a/drivers/video/nvidia/nv_i2c.c	2005-03-05 00:35:05 +08:00
+++ b/drivers/video/nvidia/nv_i2c.c	2005-03-05 00:45:44 +08:00
@@ -119,9 +119,12 @@
 	if (rc == 0)
 		dev_dbg(&chan->par->pci_dev->dev,
 			"I2C bus %s registered.\n", name);
-	else
+	else {
 		dev_warn(&chan->par->pci_dev->dev,
 			 "Failed to register I2C bus %s.\n", name);
+		chan->par = NULL;
+	}
+
 	return rc;
 }
 
@@ -174,6 +177,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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help