lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 3 Nov 2014 15:41:40 -0500
From:	Benjamin Tissoires <benjamin.tissoires@...il.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	Benjamin Tissoires <benjamin.tissoires@...hat.com>,
	Jiri Kosina <jkosina@...e.cz>,
	Nestor Lopez Casado <nlopezcasad@...itech.com>,
	linux-input <linux-input@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] HID: logitech-hidpp: fix negated returns

On Mon, Nov 3, 2014 at 3:32 PM, Dan Carpenter <dan.carpenter@...cle.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ