All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis de Bethencourt <luisbg-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
To: Sudip Mukherjee
	<sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	jikos-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()
Date: Wed, 30 Sep 2015 11:05:36 +0100	[thread overview]
Message-ID: <560BB3F0.9050307@osg.samsung.com> (raw)
In-Reply-To: <20150930100408.GA5576@sudip-pc>

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 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: returning -1 instead of -ENOMEM is sloppy
>>>
>>> Signed-off-by: Luis de Bethencourt <luisbg-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
>>> ---
>>>  drivers/hid/usbhid/hiddev.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
>>> index 2f1ddca..c5290ff 100644
>>> --- a/drivers/hid/usbhid/hiddev.c
>>> +++ b/drivers/hid/usbhid/hiddev.c
>>> @@ -894,7 +894,7 @@ int hiddev_connect(struct hid_device *hid, unsigned int force)
>>>  	}
>>>  
>>>  	if (!(hiddev = kzalloc(sizeof(struct hiddev), GFP_KERNEL)))
>>> -		return -1;
>>> +		return -ENOMEM;
>>>  
>>>  	init_waitqueue_head(&hiddev->wait);
>>>  	INIT_LIST_HEAD(&hiddev->list);
>>>
>>
>> Hello,
>>
>> I got an "Undelivered Mail Returned to Sender" from Jiri Kosina's
>> jikos-XVmvHMARGATQT0dZR+AlfA@public.gmane.org email address. This email is listed multiple times
>> in the MAINTAINERS file, does he have a new address to update this
>> file?
> Its jikos-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
> 
> regards
> sudip
> 

Hi Sudip,

*facepalm* My mistake, yes.

Sorry,
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Luis de Bethencourt <luisbg@osg.samsung.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: linux-kernel@vger.kernel.org, jikos@kernel.org,
	linux-usb@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()
Date: Wed, 30 Sep 2015 11:05:36 +0100	[thread overview]
Message-ID: <560BB3F0.9050307@osg.samsung.com> (raw)
In-Reply-To: <20150930100408.GA5576@sudip-pc>

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 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: returning -1 instead of -ENOMEM is sloppy
>>>
>>> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
>>> ---
>>>  drivers/hid/usbhid/hiddev.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
>>> index 2f1ddca..c5290ff 100644
>>> --- a/drivers/hid/usbhid/hiddev.c
>>> +++ b/drivers/hid/usbhid/hiddev.c
>>> @@ -894,7 +894,7 @@ int hiddev_connect(struct hid_device *hid, unsigned int force)
>>>  	}
>>>  
>>>  	if (!(hiddev = kzalloc(sizeof(struct hiddev), GFP_KERNEL)))
>>> -		return -1;
>>> +		return -ENOMEM;
>>>  
>>>  	init_waitqueue_head(&hiddev->wait);
>>>  	INIT_LIST_HEAD(&hiddev->list);
>>>
>>
>> Hello,
>>
>> I got an "Undelivered Mail Returned to Sender" from Jiri Kosina's
>> jikos@kernel.com email address. This email is listed multiple times
>> in the MAINTAINERS file, does he have a new address to update this
>> file?
> Its jikos@kernel.org
> 
> regards
> sudip
> 

Hi Sudip,

*facepalm* My mistake, yes.

Sorry,
Luis

  reply	other threads:[~2015-09-30 10:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30  9:52 [PATCH] HID: hiddev: fix returned errno code in hiddev_connect() Luis de Bethencourt
2015-09-30  9:56 ` Luis de Bethencourt
2015-09-30 10:04   ` Sudip Mukherjee
2015-09-30 10:05     ` Luis de Bethencourt [this message]
2015-09-30 10:05       ` Luis de Bethencourt
2015-09-30 19:40 ` Jiri Kosina
2015-10-03 21:34   ` Luis de Bethencourt
2015-10-05 14:24     ` Jiri Kosina
2015-10-06  8:58       ` Luis de Bethencourt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560BB3F0.9050307@osg.samsung.com \
    --to=luisbg-jph+aebz4p+uejcrhfaqsw@public.gmane.org \
    --cc=jikos-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.