From patchwork Sun Jan 25 08:06:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Rorvick X-Patchwork-Id: 5700931 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 19850C058D for ; Sun, 25 Jan 2015 10:01:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C809201E4 for ; Sun, 25 Jan 2015 10:01:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id AF562201D3 for ; Sun, 25 Jan 2015 10:01:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8927A260417; Sun, 25 Jan 2015 11:01:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 8342F260418; Sun, 25 Jan 2015 11:01:26 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2A40726041A; Sun, 25 Jan 2015 11:01:25 +0100 (CET) Received: from mail-qg0-f41.google.com (mail-qg0-f41.google.com [209.85.192.41]) by alsa0.perex.cz (Postfix) with ESMTP id 6C0E9260417 for ; Sun, 25 Jan 2015 11:01:18 +0100 (CET) Received: by mail-qg0-f41.google.com with SMTP id q108so3514921qgd.0 for ; Sun, 25 Jan 2015 02:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=wn9YdRRSQ0+N8ldLqImbs2hRlFtEq+vnz3u/MzdsPN8=; b=KbN1SnaYF5xxOgIwOO5aKLp0BQm3D0XtqEG+ynqE74LqVskhazZOBHpHsSomxk7b/U TgLNi0JAN/fTL3N2MtILiWNy9h8qLGS9jVLJUQ+ItMZC0nrPBhGWtfcCaArZUGSc1Jdn F1HQoGhVrjdU+xPzuJRDPaedqd5sBDpuMgFcjRcWz9NHtiQL4n9tR5fW4/i0dIt6FGis Dlhic2hu9Slr5zLAxz8ZiFpAFxwLPM72jTiz6Wfv9cWJVSwcf5cOYm578NTaZwr63IuL 6vecIELMFbons1Q3d6iGg9x9CI2R9XCRCZwj3da3a1wKrwmDSb8NDubTNfXllyCc5hkm OS8g== MIME-Version: 1.0 X-Received: by 10.140.82.47 with SMTP id g44mr28876529qgd.42.1422173179296; Sun, 25 Jan 2015 00:06:19 -0800 (PST) Received: by 10.140.91.38 with HTTP; Sun, 25 Jan 2015 00:06:19 -0800 (PST) In-Reply-To: <1422033203-23254-3-git-send-email-tiwai@suse.de> References: <1422033203-23254-1-git-send-email-tiwai@suse.de> <1422033203-23254-3-git-send-email-tiwai@suse.de> Date: Sun, 25 Jan 2015 02:06:19 -0600 X-Google-Sender-Auth: UZl-TcMDQVYdLCsJivkdDtqdle8 Message-ID: From: Chris Rorvick To: Takashi Iwai Cc: Stefan Hajnoczi , alsa-devel@alsa-project.org Subject: Re: [alsa-devel] [PATCH 02/16] ALSA: line6: Fix memory leak at probe error path X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Jan 23, 2015 at 11:13 AM, Takashi Iwai wrote: > --- a/sound/usb/line6/driver.c > +++ b/sound/usb/line6/driver.c > @@ -507,10 +507,32 @@ int line6_probe(struct usb_interface *interface, > int interface_number; > int ret; > > + ret = snd_card_new(line6->ifcdev, > + SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, > + THIS_MODULE, 0, &card); The `ifcdev' member has not been initialized yet. You need something like the following squashed in: >8------------------------------------------------------8< diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c index 2eed6fb..25d6b0f 100644 --- a/sound/usb/line6/driver.c +++ b/sound/usb/line6/driver.c @@ -507,6 +507,11 @@ int line6_probe(struct usb_interface *interface, int interface_number; int ret; + /* store basic data: */ + line6->properties = properties; + line6->usbdev = usbdev; + line6->ifcdev = &interface->dev; + ret = snd_card_new(line6->ifcdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, THIS_MODULE, 0, &card); @@ -548,11 +553,6 @@ int line6_probe(struct usb_interface *interface, goto error; } - /* store basic data: */ - line6->properties = properties; - line6->usbdev = usbdev; - line6->ifcdev = &interface->dev; - line6_get_interval(line6); if (properties->capabilities & LINE6_CAP_CONTROL) {