diff options
author | Tony Lindgren <tony@atomide.com> | 2008-01-14 15:53:30 -0500 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2008-01-14 15:53:30 -0500 |
commit | 3e39752d5367f9087e058abe768708165e1ec373 (patch) | |
tree | bc6d749167fecc4d55bb9bf707fa16b837fa9375 /drivers/i2c | |
parent | 1a1b285c24e1468afe82b09330dde5192a6e0013 (diff) |
i2c-omap: Fix NULL pointer dereferencing
This patch fixes bug #9581 reported by Marcio Buss. If kzalloc fails,
omap_i2c_write_reg() tries to reset an unallocated I2C controller.
Cc: Marcio Buss <marciobuss@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index cb55cf2ba1e9..f2552b19ea60 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -619,13 +619,13 @@ omap_i2c_probe(struct platform_device *pdev) | |||
619 | err_free_irq: | 619 | err_free_irq: |
620 | free_irq(dev->irq, dev); | 620 | free_irq(dev->irq, dev); |
621 | err_unuse_clocks: | 621 | err_unuse_clocks: |
622 | omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); | ||
622 | omap_i2c_disable_clocks(dev); | 623 | omap_i2c_disable_clocks(dev); |
623 | omap_i2c_put_clocks(dev); | 624 | omap_i2c_put_clocks(dev); |
624 | err_free_mem: | 625 | err_free_mem: |
625 | platform_set_drvdata(pdev, NULL); | 626 | platform_set_drvdata(pdev, NULL); |
626 | kfree(dev); | 627 | kfree(dev); |
627 | err_release_region: | 628 | err_release_region: |
628 | omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); | ||
629 | release_mem_region(mem->start, (mem->end - mem->start) + 1); | 629 | release_mem_region(mem->start, (mem->end - mem->start) + 1); |
630 | 630 | ||
631 | return r; | 631 | return r; |