Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3365280pxb; Tue, 20 Apr 2021 06:50:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxo/qcZFHWadku10ggNGPYFW6CAeJ/VKdZR2YCBo4+ctt7oH5wMhl4OyTeYNCjUUf/kic0R X-Received: by 2002:aa7:8e86:0:b029:25c:876c:1824 with SMTP id a6-20020aa78e860000b029025c876c1824mr15076556pfr.10.1618926607798; Tue, 20 Apr 2021 06:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618926607; cv=none; d=google.com; s=arc-20160816; b=Z4xOBmV+9n2FxeNk5mv/ADf791vcsolsAljWEv4ckdIFB7Tal4JEm733WY3xtOGIfn sQVmfSLkRIsIoQJ0QUsFSuTSbDuuxTFDAvO2UQaxDb7meNJnJGCa6Tf0SugwgaQFrzAk M6cpu7pBgFv4HA9I+l/FQsfthnRuwOwBYQ0MmbW4OG1/X1Rsc6HUgZg1O6wbYEvYq6Ax 6lLDVB86zWSzalfWRpPCGk3we7JwU3P/s6j3azhIPWh0IPp5vtrFdl6SnPbUaRujPhTC 7j6KJIpgJHe5Db/ubJupftUV1qeM6rlSpCKvfgTCf/ky/iW1Ol3h17K5fn+XJKTWzay9 fe9A== 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 :message-id:date:subject:cc:to:from; bh=7gEmAmVm9k/rw5eye+Ng0OOlI910bITxIcpwhtrTGCE=; b=zlK8Im7PVgNtljaWr8Mcr6oxZj7/cQTv8SJi9/jpXKDheZrHbBwG+5jhMSExM44nSy m3lJRXex78uXOWXC8H0Ok58imbERix3/anf64BfRHESLo+eCu4pntQVtwG0qltqJ4IM1 V9LGGQyaNK2GitmaXbCjyMWPf2FQuTCrHJFHDDD/5BKiW8vB0r/aCgGDuw+MyzpBca4f 5GhxXefYR2Bl0aOWZd7NOP7vw0sLfzxztaCHn+nEwws1A/7T6LdakWKiF2yO6E10KDwh Gp5l4/hNE5gq3OO20osp1sixYxErWC0fL3epmwLbOoQZO+KSVmizTnFwwShGEbTz9q68 6KIA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c25si7575038pgw.195.2021.04.20.06.49.55; Tue, 20 Apr 2021 06:50:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232726AbhDTNsK (ORCPT + 99 others); Tue, 20 Apr 2021 09:48:10 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:43185 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232682AbhDTNr7 (ORCPT ); Tue, 20 Apr 2021 09:47:59 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lYqil-0005VO-PT; Tue, 20 Apr 2021 13:47:19 +0000 From: Colin King To: Clemens Ladisch , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ALSA: usb: midi: don't return -ENOMEM when usb_urb_ep_type_check fails Date: Tue, 20 Apr 2021 14:47:19 +0100 Message-Id: <20210420134719.381409-1-colin.king@canonical.com> X-Mailer: git-send-email 2.30.2 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 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 --- 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 9efda4b06acb..a10ac75969a8 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -1316,7 +1316,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