From: Johan Hovold Date: Tue, 15 May 2012 17:45:40 +0000 (+0200) Subject: mfd: Fix double free in wm8350 error path X-Git-Tag: firefly_0821_release~3680^2~2729^2~24 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=65ee362cb2c13bd164ade0eda66919a2e16d8a89;p=firefly-linux-kernel-4.4.55.git mfd: Fix double free in wm8350 error path Fix double free in probe error path introduced by the recent conversion of wm8350 to use regmap. Signed-off-by: Johan Hovold Acked-by: Mark Brown Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c index 271589f8e8e3..a68aceb4e48c 100644 --- a/drivers/mfd/wm8350-i2c.c +++ b/drivers/mfd/wm8350-i2c.c @@ -49,15 +49,7 @@ static int wm8350_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, wm8350); wm8350->dev = &i2c->dev; - ret = wm8350_device_init(wm8350, i2c->irq, i2c->dev.platform_data); - if (ret < 0) - goto err; - - return ret; - -err: - regmap_exit(wm8350->regmap); - return ret; + return wm8350_device_init(wm8350, i2c->irq, i2c->dev.platform_data); } static int wm8350_i2c_remove(struct i2c_client *i2c)