summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorFugang Duan <b38611@freescale.com>2015-11-26 16:31:14 +0800
committerJason Liu <jason.hui.liu@nxp.com>2018-10-29 11:10:38 +0800
commit678a3a4175d00261364ed94b3db5bef0b87ab5ea (patch)
treea4f12cf7db3c1b74e377b150b9a7bbff3096d418 /drivers/mfd
parent20843f00ee528e830b5010e48a0ed49ad9d44c6c (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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/max17135-core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mfd/max17135-core.c b/drivers/mfd/max17135-core.c
index e5a5270c7b4d..f663f8068067 100644
--- a/drivers/mfd/max17135-core.c
+++ b/drivers/mfd/max17135-core.c
@@ -150,10 +150,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);