diff mbox

HID: ACRUX - add missing hid_hw_stop() in ax_probe() error path

Message ID 1310620071.2721.3.camel@phoenix (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

axel lin July 14, 2011, 5:07 a.m. UTC
hid_hw_stop() must be called in ax_probe() error path if hid_hw_start()
was successful.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/hid/hid-axff.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Jiri Kosina July 14, 2011, 9:43 a.m. UTC | #1
On Thu, 14 Jul 2011, Axel Lin wrote:

> hid_hw_stop() must be called in ax_probe() error path if hid_hw_start()
> was successful.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/hid/hid-axff.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hid/hid-axff.c b/drivers/hid/hid-axff.c
> index b455428..1215141 100644
> --- a/drivers/hid/hid-axff.c
> +++ b/drivers/hid/hid-axff.c
> @@ -154,6 +154,7 @@ static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id)
>  	error = hid_hw_open(hdev);
>  	if (error) {
>  		dev_err(&hdev->dev, "hw open failed\n");
> +		hid_hw_stop(hdev);
>  		return error;
>  	}

Good catch, applied. Thanks,
diff mbox

Patch

diff --git a/drivers/hid/hid-axff.c b/drivers/hid/hid-axff.c
index b455428..1215141 100644
--- a/drivers/hid/hid-axff.c
+++ b/drivers/hid/hid-axff.c
@@ -154,6 +154,7 @@  static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	error = hid_hw_open(hdev);
 	if (error) {
 		dev_err(&hdev->dev, "hw open failed\n");
+		hid_hw_stop(hdev);
 		return error;
 	}