All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <hzpeterchen@gmail.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: fix error handling
Date: Fri, 8 Jan 2016 14:01:12 +0800	[thread overview]
Message-ID: <20160108060112.GB26697@shlinux2> (raw)
In-Reply-To: <1452171637-25143-1-git-send-email-sudipm.mukherjee@gmail.com>

On Thu, Jan 07, 2016 at 06:30:37PM +0530, Sudip Mukherjee wrote:
> We are doing PTR_ERR() of NULL, and that will actually make ret = 0.
> So incase of both error and success we are actually returning the
> success code.
> 

%s/incase of/in case of

Reviewed-by: Peter Cen <peter.chen@freescale.com>

> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>  drivers/usb/gadget/composite.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index 8b14c2a..17ce6b5 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -2017,14 +2017,14 @@ int composite_os_desc_req_prepare(struct usb_composite_dev *cdev,
>  
>  	cdev->os_desc_req = usb_ep_alloc_request(ep0, GFP_KERNEL);
>  	if (!cdev->os_desc_req) {
> -		ret = PTR_ERR(cdev->os_desc_req);
> +		ret = -ENOMEM;
>  		goto end;
>  	}
>  
>  	/* OS feature descriptor length <= 4kB */
>  	cdev->os_desc_req->buf = kmalloc(4096, GFP_KERNEL);
>  	if (!cdev->os_desc_req->buf) {
> -		ret = PTR_ERR(cdev->os_desc_req->buf);
> +		ret = -ENOMEM;
>  		kfree(cdev->os_desc_req);
>  		goto end;
>  	}
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 

Best Regards,
Peter Chen

      reply	other threads:[~2016-01-08  6:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 13:00 [PATCH] usb: gadget: fix error handling Sudip Mukherjee
2016-01-08  6:01 ` Peter Chen [this message]

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=20160108060112.GB26697@shlinux2 \
    --to=hzpeterchen@gmail.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    /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.