diff options
author | Scott Williams <scwilliams@nvidia.com> | 2010-06-22 19:02:31 -0700 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-06-22 22:43:11 -0700 |
commit | 67ff721112df58bedcd8afdaf8fe5292d2313d61 (patch) | |
tree | 41526a18a468e64a32e7c6b4748bdcd54370c353 | |
parent | dfb7f92fa6b74fb3951317a9b6df63adbcfe0d9f (diff) |
tegra: Fix kernel panic in I2C open
Make sure the I2C close() function pointer has been initialized
before trying to call through that pointer. This can happen
if I2C open fails because there is no ODM configuration for the
requested controller/instance combination.
Change-Id: I790272463dad0211a439cddac61f45f36325272b
Reviewed-on: http://git-master/r/3030
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Tested-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Gary King <gking@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/nvrm/io/common/nvrm_i2c.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/nvrm/io/common/nvrm_i2c.c b/arch/arm/mach-tegra/nvrm/io/common/nvrm_i2c.c index d4eca1c6cd5f..2bd51192dbfe 100644 --- a/arch/arm/mach-tegra/nvrm/io/common/nvrm_i2c.c +++ b/arch/arm/mach-tegra/nvrm/io/common/nvrm_i2c.c @@ -315,7 +315,8 @@ fail_2: c->I2cPowerClientId = 0; fail_1: - (c->close)(c); + if (c->close) + (c->close)(c); *phI2c = 0; NvRmGpioReleasePinHandles(c->hGpio, &c->hSclPin, 1); NvRmGpioReleasePinHandles(c->hGpio, &c->hSdaPin, 1); |