From patchwork Thu Apr 7 07:28:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mengdong.lin@linux.intel.com X-Patchwork-Id: 8769241 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 837D59FBEA for ; Thu, 7 Apr 2016 07:26:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BFD71201CD for ; Thu, 7 Apr 2016 07:26:47 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B2D4B201C8 for ; Thu, 7 Apr 2016 07:26:46 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id DE3F2265DFF; Thu, 7 Apr 2016 09:26:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8E6192651B4; Thu, 7 Apr 2016 09:26:38 +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 CC2822651C9; Thu, 7 Apr 2016 09:26:36 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by alsa0.perex.cz (Postfix) with ESMTP id 9F0E7266021 for ; Thu, 7 Apr 2016 09:26:18 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 07 Apr 2016 00:26:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,448,1455004800"; d="scan'208";a="953525790" Received: from amanda-haswell-pc.sh.intel.com ([10.239.159.169]) by fmsmga002.fm.intel.com with ESMTP; 07 Apr 2016 00:26:16 -0700 From: mengdong.lin@linux.intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 7 Apr 2016 15:28:42 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 In-Reply-To: References: Cc: Mengdong Lin , tiwai@suse.de, mengdong.lin@intel.com, vinod.koul@intel.com, rakesh.a.ughreja@intel.com, liam.r.girdwood@intel.com, hardik.t.shah@intel.com, subhransu.s.prusty@intel.com Subject: [alsa-devel] [PATCH v3 1/7] topology: Use the generic pointer to free an element's object 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 From: Mengdong Lin The element is a wrapper for different types of objects.So use the generic pointer 'obj' instead of the type-specific pointer to free the object. Signed-off-by: Mengdong Lin diff --git a/src/topology/elem.c b/src/topology/elem.c index 12d6a72..00f9eea 100644 --- a/src/topology/elem.c +++ b/src/topology/elem.c @@ -83,8 +83,8 @@ void tplg_elem_free(struct tplg_elem *elem) /* free struct snd_tplg_ object, * the union pointers share the same address */ - if (elem->mixer_ctrl) - free(elem->mixer_ctrl); + if (elem->obj) + free(elem->obj); free(elem); }