Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0021586b authored by Éric Piel's avatar Éric Piel Committed by Linus Torvalds
Browse files

lis3: free regulators if probe() fails



Signed-off-by: default avatarIlkka Koskinen <ilkka.koskinen@nokia.com>
Signed-off-by: default avatarÉric Piel <eric.piel@tremplin-utc.net>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Witold Pilat <witold.pilat@gmail.com>
Cc: Lyall Pearce <lyall.pearce@hp.com>
Cc: Malte Starostik <m-starostik@versanet.de>
Cc: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d0b6a971
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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)
	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();