Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-10-06 Thread Luis de Bethencourt
On 05/10/15 15:24, Jiri Kosina wrote: > On Sat, 3 Oct 2015, Luis de Bethencourt wrote: > >>> But I am not really sure where you are seeing the bug (mapping to >>> -EPERM) in this case? I think the only caller of hiddev_connect() >>> should be hid_connect(), and the only thing that guy cares abou

Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-10-05 Thread Jiri Kosina
On Sat, 3 Oct 2015, Luis de Bethencourt wrote: > > But I am not really sure where you are seeing the bug (mapping to > > -EPERM) in this case? I think the only caller of hiddev_connect() > > should be hid_connect(), and the only thing that guy cares about > > whether individual callbacks succee

Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-10-03 Thread Luis de Bethencourt
On 30/09/15 20:40, Jiri Kosina wrote: > On Wed, 30 Sep 2015, Luis de Bethencourt wrote: > >> The driver is using -1 instead of the -ENOMEM defined macro to specify >> that a buffer allocation failed. Since the error number is propagated, >> the caller will get a -EPERM which is the wrong error con

Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-09-30 Thread Jiri Kosina
On Wed, 30 Sep 2015, Luis de Bethencourt wrote: > The driver is using -1 instead of the -ENOMEM defined macro to specify > that a buffer allocation failed. Since the error number is propagated, > the caller will get a -EPERM which is the wrong error condition. Generally I agree that the more spec

[PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-09-30 Thread Luis de Bethencourt
The driver is using -1 instead of the -ENOMEM defined macro to specify that a buffer allocation failed. Since the error number is propagated, the caller will get a -EPERM which is the wrong error condition. Also, the smatch tool complains with the following warning: hiddev_connect() warn: returnin

Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-09-30 Thread Luis de Bethencourt
On 30/09/15 11:04, Sudip Mukherjee wrote: > On Wed, Sep 30, 2015 at 10:56:26AM +0100, Luis de Bethencourt wrote: >> On 30/09/15 10:52, Luis de Bethencourt wrote: >>> The driver is using -1 instead of the -ENOMEM defined macro to specify >>> that a buffer allocation failed. Since the error number is

Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-09-30 Thread Sudip Mukherjee
On Wed, Sep 30, 2015 at 10:56:26AM +0100, Luis de Bethencourt wrote: > On 30/09/15 10:52, Luis de Bethencourt wrote: > > The driver is using -1 instead of the -ENOMEM defined macro to specify > > that a buffer allocation failed. Since the error number is propagated, > > the caller will get a -EPERM

Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-09-30 Thread Luis de Bethencourt
On 30/09/15 10:52, Luis de Bethencourt wrote: > The driver is using -1 instead of the -ENOMEM defined macro to specify > that a buffer allocation failed. Since the error number is propagated, > the caller will get a -EPERM which is the wrong error condition. > > Also, the smatch tool complains wit