提交 d3d9adfe 编写于 作者: C Christophe JAILLET 提交者: Jiri Kosina

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: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 572d3c64
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册