1
0
Fork 0

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 <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
hifive-unleashed-5.1
Christophe JAILLET 2017-02-19 13:07:59 +01:00 committed by Jiri Kosina
parent 572d3c6444
commit d3d9adfe30
1 changed files with 1 additions and 1 deletions

View File

@ -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);