aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/staging/greybus/hid.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2015-03-27 12:45:45 +0100
committerGreg Kroah-Hartman <greg@kroah.com>2015-03-30 15:17:37 +0200
commitecf47ab9c5ca1427baea7ab6d3226502d967f19d (patch)
treec300b161344ea7865d879c9761091e067f2c578e /drivers/staging/greybus/hid.c
parentgreybus: hid: replace pr_err with dev_err (diff)
downloadwireguard-linux-ecf47ab9c5ca1427baea7ab6d3226502d967f19d.tar.xz
wireguard-linux-ecf47ab9c5ca1427baea7ab6d3226502d967f19d.zip
greybus: hid: fix success response being sent on errors
Make sure to only send a success response if we did not detect any errors. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/hid.c')
-rw-r--r--drivers/staging/greybus/hid.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/greybus/hid.c b/drivers/staging/greybus/hid.c
index 9734c7b35cc2..f0da387476b8 100644
--- a/drivers/staging/greybus/hid.c
+++ b/drivers/staging/greybus/hid.c
@@ -163,13 +163,6 @@ static void gb_hid_irq_handler(u8 type, struct gb_operation *op)
return;
}
- ret = gb_operation_response_send(op, 0);
- if (ret) {
- dev_err(&connection->dev,
- "failed to send response status %d: %d\n",
- 0, ret);
- }
-
size = request->report[0] | request->report[1] << 8;
if (!size) {
dev_err(&connection->dev, "bad report size: %d\n", size);
@@ -179,6 +172,13 @@ static void gb_hid_irq_handler(u8 type, struct gb_operation *op)
if (test_bit(GB_HID_STARTED, &ghid->flags))
hid_input_report(ghid->hid, HID_INPUT_REPORT,
request->report + 2, size - 2, 1);
+
+ ret = gb_operation_response_send(op, 0);
+ if (ret) {
+ dev_err(&connection->dev,
+ "failed to send response status %d: %d\n",
+ 0, ret);
+ }
}