From patchwork Mon Sep 17 08:26:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10602219 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 205001508 for ; Mon, 17 Sep 2018 08:45:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D9F1295CA for ; Mon, 17 Sep 2018 08:45:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F31B929670; Mon, 17 Sep 2018 08:45:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C512B295CA for ; Mon, 17 Sep 2018 08:45:46 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E5CC126788B; Mon, 17 Sep 2018 10:26:52 +0200 (CEST) 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 71494267893; Mon, 17 Sep 2018 10:26:51 +0200 (CEST) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by alsa0.perex.cz (Postfix) with ESMTP id 1008426787F for ; Mon, 17 Sep 2018 10:26:48 +0200 (CEST) Received: by mail-pf1-f193.google.com with SMTP id h79-v6so7202696pfk.8 for ; Mon, 17 Sep 2018 01:26:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=oYJ2dIoC0unSJZn+kz8ppLOwRtXRN1KCDxpf8JjpOEA=; b=N1lvRBZ4rj4k6caSkRa9oRNx1OQaRxfL0iRY7hkWC/s3o4FQ6d7fR9H5iSgJ7rJhhI j+yTGxViFvxK6By3bhnrVl9bmr+p7xIMyoHsvRf9UT8qhF/M6NI3aQuKOZ/NtJbXnESa TPCji/GPV6UHjNbQl2ejoR/HiLRCdl7vSJ2BVSglZ4KC1TqhFxEaijXBBt1A6GjorDaX U2GCGHwytC+pseN3tMTXgQI60g2NCPu0JCWFmPsWiXU3oXEocHdDQBH7JcrU5/TUk5fT XqIS3EfO9OjHT7V/rTgnCmS8a1OYt7zGfuzBgQn6Z6pEM+6d6njJfdudLAODZS2RVNTv elNw== X-Gm-Message-State: APzg51A9XWf9trFLVfLTgjuE042Co6MSJ+CSO7QpitLokH0rERMjeUyl u4Pa6W5UtmFTYPACGOMRq4k= X-Google-Smtp-Source: ANB0VdaZHDgCkmMLf8ZurhK0UT9R0aRA+lli58ZZ3dUz0NsJ7635AYYuSn6FDFteyDAhoeF1W6xbAQ== X-Received: by 2002:a63:a112:: with SMTP id b18-v6mr19951218pgf.384.1537172807343; Mon, 17 Sep 2018 01:26:47 -0700 (PDT) Received: from localhost.localdomain ([2405:6580:9660:3200:60c7:933c:fe9f:29ca]) by smtp.gmail.com with ESMTPSA id x23-v6sm19390155pff.9.2018.09.17.01.26.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Sep 2018 01:26:46 -0700 (PDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Mon, 17 Sep 2018 17:26:41 +0900 Message-Id: <20180917082641.11734-1-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.17.1 Cc: alsa-devel@alsa-project.org, stable@vger.kernel.org Subject: [alsa-devel] [PATCH] ALSA: fireworks: fix memory leak of response buffer at 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP After allocating memory object for response buffer, ALSA fireworks driver has leak of the memory object at error path. This commit releases the object at the error path. Fixes: 7d3c1d5901aa('ALSA: fireworks: delayed registration of sound card') Cc: # v4.7+ Signed-off-by: Takashi Sakamoto --- sound/firewire/fireworks/fireworks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/firewire/fireworks/fireworks.c b/sound/firewire/fireworks/fireworks.c index 71a0613d3da0..f2d073365cf6 100644 --- a/sound/firewire/fireworks/fireworks.c +++ b/sound/firewire/fireworks/fireworks.c @@ -301,6 +301,8 @@ do_registration(struct work_struct *work) snd_efw_transaction_remove_instance(efw); snd_efw_stream_destroy_duplex(efw); snd_card_free(efw->card); + kfree(efw->resp_buf); + efw->resp_buf = NULL; dev_info(&efw->unit->device, "Sound card registration failed: %d\n", err); }