Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4999106ybh; Tue, 6 Aug 2019 22:32:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhd5ASWSuDBWeGuz9jZxT5Ga40rqHMsKs3Q27wxjsDaPAPkseniOsbxHXLLzvSP6LtCSDv X-Received: by 2002:a17:902:d90a:: with SMTP id c10mr6383311plz.208.1565155962597; Tue, 06 Aug 2019 22:32:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565155962; cv=none; d=google.com; s=arc-20160816; b=IQzDY7G9DS6mZhFG6dJWeIatJsPbUUrhWTbp8jPX29YzsHny2nr/TUQvy9xLnp7IId wxX0/FgPOaLXmg3Mi1UmfP3T/O/skz7dmoz0dFz9DEnRLDUl1XcXnbIx78spoX9K40p7 JQnesa+guWHsFKHS4x3JG1UNJDQ2IykB2eABHHkkfHwmyvBRA0NafGnq0gLn8zlByxvr oPp6BTvbiQhUodedOmUwtcrgFho5vYx+VjE0a0M87lbkmvnf7/pVlG0CxIWJ45V63pCS 5Yrn3vIFR52uDfebyIJb2UsE4mHh0tEQ9eYKSzi2IoaM0rnzmDNJL+khB8vznh274q1v +6Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=51C/GoBA/uE1ju1tRnWATIj+35w5kvGWT8UNQJ4UM1Q=; b=YdngtbWI6t8/KqDl8/yaEgkMDwYUNSis3apoY8sIjBS2t0gkucm2grtI3NeRDQlIsJ iRDtdbphl/Ckh+9O4slrd+IezE1Nj94Yodjh/7PNovx7HPbHAPULfepDO/HXGykB04X3 yLsOfe0cRiv0k9imtH3nMw8+++/L4KQ9eYg2y8Oe3c6iXc4JeZ7o35wjdtbxgoKdrsGm 1+nYRm+sXWVrxHGGz2iNaWgXBCa2JGXly0bLLg0UkIFkAh1yh8RGka20fgPlyks7zsag UbPAO6QnUIo+5kca/SKAzI1u87Afnr99dgwyULRfY7QbLe81/dAyIt1cy2si9Enz5JcN Ziww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s186si10652567pgs.116.2019.08.06.22.32.27; Tue, 06 Aug 2019 22:32:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726258AbfHGFbt (ORCPT + 99 others); Wed, 7 Aug 2019 01:31:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:54382 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725794AbfHGFbt (ORCPT ); Wed, 7 Aug 2019 01:31:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 40D06B009; Wed, 7 Aug 2019 05:31:48 +0000 (UTC) Date: Wed, 07 Aug 2019 07:31:47 +0200 Message-ID: From: Takashi Iwai To: Wenwen Wang Cc: "moderated list:SOUND" , Clemens Ladisch , Jaroslav Kysela , Takashi Iwai , open list Subject: Re: [PATCH] ALSA: usb-midi: fix a memory leak bug In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 07 Aug 2019 05:22:09 +0200, Wenwen Wang wrote: > > In __snd_usbmidi_create(), a MIDI streaming interface structure is > allocated through kzalloc() and the pointer is saved to 'umidi'. Later on, > the endpoint structures are created by invoking > snd_usbmidi_create_endpoints_midiman() or snd_usbmidi_create_endpoints(), > depending on the type of the audio quirk type. However, if the creation > fails, the allocated 'umidi' is not deallocated, leading to a memory leak > bug. > > To fix the above issue, free 'umidi' before returning the error. > > Signed-off-by: Wenwen Wang It's again a false-positive report. The object is released automatically by the destructor of its base snd_rawmidi object. thanks, Takashi