Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2968909ybk; Mon, 18 May 2020 12:22:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBoUxMD/DwAiNEE7LbnkyGJad2R+lJnGgmVl/kMoGTK+jx4Z58w68UvLBiytQqME98drdI X-Received: by 2002:a17:906:304d:: with SMTP id d13mr15141280ejd.159.1589829739509; Mon, 18 May 2020 12:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589829739; cv=none; d=google.com; s=arc-20160816; b=OwzFlHxiSjx66MSYAhIg1m7WzKB2VrBs9tA4kezNuUir0ogBN78XYjq6D6qbepVchB W6+CfE60/gGI10a6htAc5bMJxRklN8JdaEA+orDW1ADO0X2hSIexpBvG/VsKKD3BWvcr YSC37NiuxfdD313z4Ye1OJQhJkmMmNw19T4R0MS0utF88VcXekCnhi4EuVug2ffciaJP UjblSZchMn57oi1NR/Tyw9BXvzQlV7Rk9CmdE/0Tl4DMJIHlb5B30GHT8Lo+32EFoyMy 4/0kbPsM/MeMtnryONugBgowXTCgoqRovOFV6+eoWqvhBu7KHmjY68ZgcNBgvUQ+YE2R +V9Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W5tGrqgnSEytmwZnBMDuBa4MyGg21xNfM3d59QmvMIs=; b=rSZ9JJDWKfMGdI593mFOieqDANnQy+BhyIGocRI3sXGEO3PL+CWQ8srm4hgKP//ito 35kYOMEyTZLo8A3sEefh7xp2fiOYJsEd7twfHU1X1HgA1bjfYU4lsH2xgm8sPM6bSkO5 jNxUWhGZmeTUMdZJBenTZAW4NhS7ji23lStmnsPTKH0Fp2T4lWVmOBa4KdWReNJhF3ZG B+w/R8e5ZWyVex7SZ5RPsMGRi++uasYTfqEvMWWTXsBBhBkMiaMFWjR5b5SarojIlze7 FSpMzD+F64z5h0lrIFXLAP6fJstuWPyENyJiCMVmVKkop6GktQNf1INA1dE92p7pgAOH oArg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QtmzQk6t; 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 w19si4228295edx.164.2020.05.18.12.21.54; Mon, 18 May 2020 12:22:19 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QtmzQk6t; 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 S1730286AbgERRxk (ORCPT + 99 others); Mon, 18 May 2020 13:53:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:57736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731173AbgERRxi (ORCPT ); Mon, 18 May 2020 13:53:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8A8CE207C4; Mon, 18 May 2020 17:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589824418; bh=bDJ1mgZU+h5ToiLcvLdkwXTROH+5BR7TJ+0MyXthK4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QtmzQk6t6QyK3krBYCiiVE68wECaRlIE/a5IFSiuL9FfSU9JsHthh1TQelaGI4Da3 aBxnYPBR/+BUAWqu2Q26d3LC/2BQtN/IRE1TQbdCuUEsnSHF7mPZdL9dCXuZUH5him 1Vbq+gwC7uVgweDGc6E92m3iryVQCB4XwNSPpq7w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Chen , Christophe JAILLET , Felipe Balbi Subject: [PATCH 4.19 69/80] usb: gadget: audio: Fix a missing error return value in audio_bind() Date: Mon, 18 May 2020 19:37:27 +0200 Message-Id: <20200518173504.266735216@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173450.097837707@linuxfoundation.org> References: <20200518173450.097837707@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET commit 19b94c1f9c9a16d41a8de3ccbdb8536cf1aecdbf upstream. 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") Reviewed-by: Peter Chen Signed-off-by: Christophe JAILLET Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/legacy/audio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/gadget/legacy/audio.c +++ b/drivers/usb/gadget/legacy/audio.c @@ -300,8 +300,10 @@ static int audio_bind(struct usb_composi 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;