From d3d9adfe3059cb5cb330a2da74ea0bad49b482c0 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sun, 19 Feb 2017 13:07:59 +0100 Subject: HID: i2c-hid: Fix error handling According to error handling in this function, it is likely that some resources should be freed before returning. Replace 'return ret', with 'goto err'. While at it, remove some spaces at the beginning of the lines to be more consistent. Fixes: ead0687fe304a ("HID: i2c-hid: support regulator power on/off") Signed-off-by: Christophe JAILLET Signed-off-by: Jiri Kosina --- drivers/hid/i2c-hid/i2c-hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/hid') diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index a3f6daf0886b..a83814949467 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -1064,7 +1064,7 @@ static int i2c_hid_probe(struct i2c_client *client, if (ret != -EPROBE_DEFER) dev_err(&client->dev, "Failed to get regulator: %d\n", ret); - return ret; + goto err; } ret = regulator_enable(ihid->pdata.supply); -- cgit v1.2.3-59-g8ed1b