All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: "balbi@kernel.org" <balbi@kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jun.li@freescale.com" <jun.li@freescale.com>,
	"rogerq@ti.com" <rogerq@ti.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] usb: gadget: audio: Fix a missing error return value in audio_bind()
Date: Wed, 06 May 2020 09:03:33 +0000	[thread overview]
Message-ID: <20200506090358.GD30237@b29397-desktop> (raw)
In-Reply-To: <20200503104707.148996-1-christophe.jaillet@wanadoo.fr>

On 20-05-03 12:47:07, Christophe JAILLET wrote:
> If 'usb_otg_descriptor_alloc()' fails, we must return an error code, not 0.
> 
> Fixes: 56023ce0fd70 ("usb: gadget: audio: allocate and init otg descriptor by otg capabilities")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/usb/gadget/legacy/audio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/legacy/audio.c b/drivers/usb/gadget/legacy/audio.c
> index dd81fd538cb8..a748ed0842e8 100644
> --- a/drivers/usb/gadget/legacy/audio.c
> +++ b/drivers/usb/gadget/legacy/audio.c
> @@ -300,8 +300,10 @@ static int audio_bind(struct usb_composite_dev *cdev)
>  		struct usb_descriptor_header *usb_desc;
>  
>  		usb_desc = usb_otg_descriptor_alloc(cdev->gadget);
> -		if (!usb_desc)
> +		if (!usb_desc) {
> +			status = -ENOMEM;
>  			goto fail;
> +		}
>  		usb_otg_descriptor_init(cdev->gadget, usb_desc);
>  		otg_desc[0] = usb_desc;
>  		otg_desc[1] = NULL;
> -- 
> 2.25.1
> 

Reviewed-by: Peter Chen <peter.chen@nxp.com>

-- 

Thanks,
Peter Chen

WARNING: multiple messages have this Message-ID (diff)
From: Peter Chen <peter.chen@nxp.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: "balbi@kernel.org" <balbi@kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jun.li@freescale.com" <jun.li@freescale.com>,
	"rogerq@ti.com" <rogerq@ti.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] usb: gadget: audio: Fix a missing error return value in audio_bind()
Date: Wed, 6 May 2020 09:03:33 +0000	[thread overview]
Message-ID: <20200506090358.GD30237@b29397-desktop> (raw)
In-Reply-To: <20200503104707.148996-1-christophe.jaillet@wanadoo.fr>

On 20-05-03 12:47:07, Christophe JAILLET wrote:
> If 'usb_otg_descriptor_alloc()' fails, we must return an error code, not 0.
> 
> Fixes: 56023ce0fd70 ("usb: gadget: audio: allocate and init otg descriptor by otg capabilities")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/usb/gadget/legacy/audio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/legacy/audio.c b/drivers/usb/gadget/legacy/audio.c
> index dd81fd538cb8..a748ed0842e8 100644
> --- a/drivers/usb/gadget/legacy/audio.c
> +++ b/drivers/usb/gadget/legacy/audio.c
> @@ -300,8 +300,10 @@ static int audio_bind(struct usb_composite_dev *cdev)
>  		struct usb_descriptor_header *usb_desc;
>  
>  		usb_desc = usb_otg_descriptor_alloc(cdev->gadget);
> -		if (!usb_desc)
> +		if (!usb_desc) {
> +			status = -ENOMEM;
>  			goto fail;
> +		}
>  		usb_otg_descriptor_init(cdev->gadget, usb_desc);
>  		otg_desc[0] = usb_desc;
>  		otg_desc[1] = NULL;
> -- 
> 2.25.1
> 

Reviewed-by: Peter Chen <peter.chen@nxp.com>

-- 

Thanks,
Peter Chen

  reply	other threads:[~2020-05-06  9:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03 10:47 [PATCH] usb: gadget: audio: Fix a missing error return value in audio_bind() Christophe JAILLET
2020-05-03 10:47 ` Christophe JAILLET
2020-05-06  9:03 ` Peter Chen [this message]
2020-05-06  9:03   ` Peter Chen

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=20200506090358.GD30237@b29397-desktop \
    --to=peter.chen@nxp.com \
    --cc=balbi@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=jun.li@freescale.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rogerq@ti.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.