Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5261651ybh; Wed, 7 Aug 2019 03:22:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGazAjB7fL3Vx6m/pCoFPLlNT3o+YU6/M8oHLj4TCpycyGHJrm++k52d2jHk2CrP7lgg/k X-Received: by 2002:a65:534c:: with SMTP id w12mr7090668pgr.51.1565173365675; Wed, 07 Aug 2019 03:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565173365; cv=none; d=google.com; s=arc-20160816; b=VIUL+dqgxAjxOX/VcrBjJyn8v0NvOYKTG4waB9fYi/AOqRbodtJ1Fr6DZJYgEKlqXT 8LFaMfy1pbG2emSMNuntNqeV68MfuLDnF1CwhvaDdGKekLtV8N+qoHb6TAn7B0hQTevW XRapJCHZWPmW4f2RZw4M/YMFXDiDlxxQlOGtzuwZvAVDh++ZU32fTJKnnjPHPsd34KwW 4W/+f7nfI/vWk8PKCRjoQl9r5yow7clUkXIP9Yk+91gMN2O2SN/pYDmyQ8AUg/aPNsAz IWBBw7fXQuIFEjxKX3jRPo3NzAGardsQCPs4ualceLKXW6Q6cC3M5RmMroGpIfSgauyy Q/pw== 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=/WRmKzF+8OBSmiLe80jXmAesZSOu+xU09f3nSrOI+84=; b=Zx1SYtLVyvwDR+10TypoW15FxxeoN0joq0oS/xbgcdaC0jwrL/qVkx8NSpTLOpvk4X AnhxgTqPtqK8NX5opz6vjSFXbrnhubLwtvaOH6CWZ9V49kjCUnZ774FTanxZayBUOd0M aciPnz4gWapXyVnp3sA/gALUY8ZWYO13+P+cPQnSHhnznejkSeVHKJmatvcWUVS9d1yv So9czedsr/Sn8+rGkJjBCqSRgzSc4b/JMLEArUKQAUNBUoXUqiBDDrMAkwiVPmIGIB3i g4+mpOIngR6kZtv/VHVqHdQlcjPv2UL4ZIdPlHnQiYFn3T8vNJzuHuODqLtPDcyLASb2 KxyA== 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 f23si48716209pga.449.2019.08.07.03.22.29; Wed, 07 Aug 2019 03:22:45 -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 S1727045AbfHGKV3 (ORCPT + 99 others); Wed, 7 Aug 2019 06:21:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:55770 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725789AbfHGKV3 (ORCPT ); Wed, 7 Aug 2019 06:21:29 -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 DC7C1AF1E; Wed, 7 Aug 2019 10:21:27 +0000 (UTC) Date: Wed, 07 Aug 2019 12:21:27 +0200 Message-ID: From: Takashi Iwai To: Wenwen Wang Cc: "moderated list:SOUND" , Thomas Gleixner , Greg Kroah-Hartman , Allison Randal , Jaroslav Kysela , Takashi Iwai , open list Subject: Re: [PATCH v3] ALSA: hiface: fix multiple memory leak bugs In-Reply-To: <1565168932-6337-1-git-send-email-wenwen@cs.uga.edu> References: <1565168932-6337-1-git-send-email-wenwen@cs.uga.edu> 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 11:08:51 +0200, Wenwen Wang wrote: > > In hiface_pcm_init(), 'rt' is firstly allocated through kzalloc(). Later > on, hiface_pcm_init_urb() is invoked to initialize 'rt->out_urbs[i]'. In > hiface_pcm_init_urb(), 'rt->out_urbs[i].buffer' is allocated through > kzalloc(). However, if hiface_pcm_init_urb() fails, both 'rt' and > 'rt->out_urbs[i].buffer' are not deallocated, leading to memory leak bugs. > Also, 'rt->out_urbs[i].buffer' is not deallocated if snd_pcm_new() fails. > > To fix the above issues, free 'rt' and 'rt->out_urbs[i].buffer'. > > Signed-off-by: Wenwen Wang Applied now. Thanks! Takashi