Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4631114pxj; Wed, 12 May 2021 09:37:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFMInL8NmdAwO5EaRclL28oItN6Eu0owXooZDirPdWTy/DtZ8OOFo8pakBJhAO7UBpVyNu X-Received: by 2002:a17:906:9159:: with SMTP id y25mr843513ejw.144.1620837457869; Wed, 12 May 2021 09:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837457; cv=none; d=google.com; s=arc-20160816; b=xFrAFSpIb2D9rupO5CRKiMcoFss21As4gt3cKiPuqfzLiaYhv74hHGOTktAOqknUbL KfF+HQn+uVK/C4Ftpxm016TK26DJiVh2qQlUtWPLLjlFBq6ZG49BX6GcaGGM/sTAOGME Vxbp3TA5XuSlqbVefV0duiy1GP7T8A8cII9quY1X/wB6rS/dSUT0XztJz5tRc0vS5wfd j3ZbRhuF0l1rjU1FD6h27cNa1VCenspOfdGzg+JKGkTjqgv2aJZbrwRt+b7/10zQjPo3 MmCOq68Hd29ubGawqaf6Vo6pFXfUBCfo9M8ezwnGi2b6XNc/hAVHaP9za5dBxdDNrJeA Eowg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=X8pZDKDiJOWHcTi1nz/Zl5sod5rARxOI3vwuy76Ip3A=; b=gx5ukDeDjVuLojXaYy11edo/w2RCQav7/Lp8D2XCqQlTBEKOsAvrCml+AuAWgIHaYf hir4q088XsoTzhvdRlrxnZADid8PCOlXttBnmpa/yplVA1WONZ7MP0RI3rvNJsnl6+Yj RY6QftFFTXt/SmXFf0ApTp0YCY9WYi+3YRvSSYxqPEotiHrWygjmGWQiq2D9dzyFP0hp vz5Hqe7WqP4/zfcMYRInoMiBgJL8cZC7xdrMF/22tFGW2Zv3soaEaGSJP6aLKicXCiPj yVpY4kyp/adjXqHz2pW703i5+C+dIobKGN/Ay2WBuMPGnUAa75pSX5aFSdm2SYJuREHV Qhnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mbcdGOw0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si262077ejh.112.2021.05.12.09.37.11; Wed, 12 May 2021 09:37:37 -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=@linuxfoundation.org header.s=korg header.b=mbcdGOw0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242426AbhELQet (ORCPT + 99 others); Wed, 12 May 2021 12:34:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:35404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235079AbhELPmX (ORCPT ); Wed, 12 May 2021 11:42:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7661B61C7B; Wed, 12 May 2021 15:21:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832913; bh=4SQ8Du/Ac4InSMYqvQIXgTAKsN7vFN1M6B4BRbLkn+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mbcdGOw0HIMz8ynkLCjYNJwKFb6RNxhlmPorcbjUFRQMIiRA0vOD3DtO47fW8BP5v MEev2OKz/R3pUt58C+PGmYTwdlziFSw6fDkkENQgBRKLVjmEtyxzCyUnGZ1zqEHDDl nYgaQ7KNeHTg8PO+17l7yncFgZ1yoNBJChCeillg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Takashi Iwai , Sasha Levin Subject: [PATCH 5.10 472/530] ALSA: usb: midi: dont return -ENOMEM when usb_urb_ep_type_check fails Date: Wed, 12 May 2021 16:49:42 +0200 Message-Id: <20210512144835.271285470@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit cfd577acb769301b19c31361d45ae1f145318b7a ] Currently when the call to usb_urb_ep_type_check fails (returning -EINVAL) the error return path returns -ENOMEM via the exit label "error". Other uses of the same error exit label set the err variable to -ENOMEM but this is not being used. I believe the original intent was for the error exit path to return the value in err rather than the hard coded -ENOMEM, so return this rather than the hard coded -ENOMEM. Addresses-Coverity: ("Unused value") Fixes: 738d9edcfd44 ("ALSA: usb-audio: Add sanity checks for invalid EPs") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210420134719.381409-1-colin.king@canonical.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/usb/midi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/usb/midi.c b/sound/usb/midi.c index 0c23fa6d8525..cd46ca7cd28d 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -1332,7 +1332,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi, error: snd_usbmidi_in_endpoint_delete(ep); - return -ENOMEM; + return err; } /* -- 2.30.2