lkml.org 
[lkml]   [2014]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/2] HID: logitech-hidpp: fix negated returns
From
On Mon, Nov 3, 2014 at 3:32 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Mon, Nov 03, 2014 at 02:50:52PM -0500, Benjamin Tissoires wrote:
>> @@ -524,8 +541,11 @@ static int hidpp_touchpad_get_raw_info(struct hidpp_device *hidpp,
>> ret = hidpp_send_fap_command_sync(hidpp, feature_index,
>> CMD_TOUCHPAD_GET_RAW_INFO, NULL, 0, &response);
>>
>> - if (ret)
>> - return -ret;
>> + if (ret > 0) {
>> + hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n",
>> + __func__, ret);
>> + return -EPROTO;
>> + }
>
> We should handle -ENOMEM and -EINVAL here as well. Something like:
>
> if (ret > 0) {
> hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n",
> __func__, ret);
> ret = -EPROTO;
> }
> if (ret)
> return ret;

Ouch. my bad...
No, I don't have any excuses for that.

Thanks for the review.

Cheers,
Benjamin


\
 
 \ /
  Last update: 2014-11-03 22:01    [W:0.055 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site