From 3257f4daaa46c6447047396194c7ffe9d596b37d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=89ric=20Piel?= Date: Wed, 3 Aug 2011 10:53:00 +1000 Subject: [PATCH] =?utf8?q?Signed-off-by:=20Ilkka=20Koskinen=20=20Signed-off-by:=20=C3=89ric=20Piel=20=20Cc:=20Matthew=20Garrett=20?= =?utf8?q?=20Cc:=20Witold=20Pilat=20=20Cc:=20Lyall?= =?utf8?q?=20Pearce=20=20Cc:=20Malte=20Starostik=20=20Cc:=20Thadeu=20Lima=20de=20Souza=20Cas?= =?utf8?q?cardo=20=20Cc:=20Christian=20Lamparter?= =?utf8?q?=20=20Signed-off-by:=20Andrew=20Morton?= =?utf8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- drivers/misc/lis3lv02d/lis3lv02d_i2c.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c index b20dfb4522d2..ea9159c65b58 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c @@ -161,8 +161,13 @@ static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client, if (lis3_dev.reg_ctrl) lis3_reg_ctrl(&lis3_dev, LIS3_REG_OFF); - if (ret == 0) - return 0; + if (ret) + goto fail2; + return 0; + +fail2: + regulator_bulk_free(ARRAY_SIZE(lis3_dev.regulators), + lis3_dev.regulators); fail: if (pdata && pdata->release_resources) pdata->release_resources(); -- 2.39.5