Commit 71b2cdc4 authored by Antonino Daplas's avatar Antonino Daplas Committed by Linus Torvalds

[PATCH] rivafb: Fix i2c error handling

Fixed error handling in rivafb-i2c.c if bus registration fails.
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 20067d73
......@@ -120,8 +120,12 @@ static int riva_setup_i2c_bus(struct riva_i2c_chan *chan, const char *name)
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;
}
......@@ -172,6 +176,9 @@ static u8 *riva_do_probe_i2c_edid(struct riva_i2c_chan *chan)
};
u8 *buf;
if (!chan->par)
return NULL;
buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
if (!buf) {
dev_warn(&chan->par->pdev->dev, "Out of memory!\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment