Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2553813ybz; Sun, 3 May 2020 03:49:36 -0700 (PDT) X-Google-Smtp-Source: APiQypJzx1CyPf35+Qys4s3byxQeVU990xmjWgByGqtVlxiWhe05NyYofmL3ZQvmHYVCjtZnZLpG X-Received: by 2002:a50:ef18:: with SMTP id m24mr10361531eds.281.1588502976757; Sun, 03 May 2020 03:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588502976; cv=none; d=google.com; s=arc-20160816; b=hbpaio77QYqR6ycqmwuza+/00FgS4iKuPlec9TMV50FhjW0uqV3+rviNliwzh1kxHu COHCIqI+/RiJ6h8yxKm3VumCAhJO+8/0bQC701EqitXpJWXGRSUSgKAMEzHLzJHtmonx xKV+mdrwRzGw/8LSmiKIAcSjNY1twm4DK6/7cYgZj0TcgHRt5MOWAgccz1uiJ1pc9f49 a79drynVGsXFqAYTodYwJJdQO3YnlHITXwTr10744d8cqi5I8a5ZquB5dVvCGFHwcWfQ b741xPrhXtpT9sK96+XhmUYfVCoDFhoN1FWHDK/uznRrtsLmJSTjn6W5ZHEl/eMj9UZa UAzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=4nH5a+udWpriOZn02IbIiW7FW8awODCApbEq3Pqesa0=; b=G3o9OIDum5R6Cr42SlBPPToBL7KmYAKpVM6MznYYwQ5lvcayV0sM4fvFoBKoYIg2ha +h4zCIgoT+FFj5OgYNJ5vlrtrjUlfldOwdHEznFQkzxJpOGnXCjsVMYJyeQZBLzGHADj YrIvpZWBodw2oR4IO0Xp7xO+RHSlGKCMv3EIE4OMpWWce+IRebJD4hYmepRK92RJKe/P hyuGg+bmGGgUyF3ZBJ0yokpZxVDvp5gejSIMB9esYBCm0zDSLamVxEiezCJ2LcdrwldV DqkWNrQrhpKBEjhljDpuzeSvk7p30x8Vgng5Rz7FxMG2SWZAMOZIiN2sBr0g3EAasOze JxuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si4739784ejx.373.2020.05.03.03.49.11; Sun, 03 May 2020 03:49:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728142AbgECKrQ (ORCPT + 99 others); Sun, 3 May 2020 06:47:16 -0400 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:39565 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727125AbgECKrQ (ORCPT ); Sun, 3 May 2020 06:47:16 -0400 Received: from localhost.localdomain ([93.22.132.225]) by mwinf5d60 with ME id aAnA220074rwLad03AnAgQ; Sun, 03 May 2020 12:47:14 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 03 May 2020 12:47:14 +0200 X-ME-IP: 93.22.132.225 From: Christophe JAILLET To: balbi@kernel.org, gregkh@linuxfoundation.org, jun.li@freescale.com, rogerq@ti.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] usb: gadget: audio: Fix a missing error return value in audio_bind() Date: Sun, 3 May 2020 12:47:07 +0200 Message-Id: <20200503104707.148996-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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