diff options
author | Fugang Duan <b38611@freescale.com> | 2015-11-26 16:31:14 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:46:06 +0800 |
commit | d562e283fa9b647f2892d7fce1e01738dfef805e (patch) | |
tree | dfb69386a9ba6be1f7e60aa748d1f6b7a7acae2a /drivers/mfd | |
parent | 6d060397765563121b76a6d4089ac6329c326433 (diff) |
MLK-11908 mfd: MAX17135: don't free i2c device client
i2c device client shouldn't be freed by i2c device driver, there have
problems in below cases:
- one device match to different drivers, the second matched driver will
cannot access i2c device client if it is freed by the first matched
driver.
- one module driver insmod: the first insmod fail free client due to system
low memory, after kswapd system free pages and has enough free pages, the
second insmod will cause match failed.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/max17135-core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mfd/max17135-core.c b/drivers/mfd/max17135-core.c index 03773ec6f931..a91d01fb6bb5 100644 --- a/drivers/mfd/max17135-core.c +++ b/drivers/mfd/max17135-core.c @@ -137,10 +137,8 @@ static int max17135_probe(struct i2c_client *client, /* Create the PMIC data structure */ max17135 = kzalloc(sizeof(struct max17135), GFP_KERNEL); - if (max17135 == NULL) { - kfree(client); + if (max17135 == NULL) return -ENOMEM; - } /* Initialize the PMIC data structure */ i2c_set_clientdata(client, max17135); |