From patchwork Wed Mar 18 16:01:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 6041501 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 B4D739F314 for ; Wed, 18 Mar 2015 16:05:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A2D820450 for ; Wed, 18 Mar 2015 16:05:49 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E43812024F for ; Wed, 18 Mar 2015 16:05:47 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D7F0E2605A3; Wed, 18 Mar 2015 17:05:46 +0100 (CET) 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, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id F348B260439; Wed, 18 Mar 2015 17:05:39 +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 F272B2604A7; Wed, 18 Mar 2015 17:05:37 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by alsa0.perex.cz (Postfix) with ESMTP id C1910260422 for ; Wed, 18 Mar 2015 17:05:30 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 18 Mar 2015 08:59:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,423,1422950400"; d="scan'208";a="700515593" Received: from vkoul-udesk3.iind.intel.com ([10.223.84.65]) by orsmga002.jf.intel.com with ESMTP; 18 Mar 2015 09:05:27 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Wed, 18 Mar 2015 21:31:38 +0530 Message-Id: <1426694498-10811-1-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.7.9.5 Cc: Vinod Koul , broonie@kernel.org, lgirdwood@gmail.com, Dan Carpenter Subject: [alsa-devel] [PATCH] ASoC: Intel: acpi_probe: fix error return 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 Fix the sst_acpi_probe memory allocation error path by setting right error code and initiating the cleanup insteadof just returning Signed-off-by: Vinod Koul Reported-by: Dan Carpenter --- sound/soc/intel/sst/sst_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/sst/sst_acpi.c b/sound/soc/intel/sst/sst_acpi.c index b782dfdcdbba..b536ddd2517d 100644 --- a/sound/soc/intel/sst/sst_acpi.c +++ b/sound/soc/intel/sst/sst_acpi.c @@ -309,7 +309,7 @@ static int sst_acpi_probe(struct platform_device *pdev) ctx->shim_regs64 = devm_kzalloc(ctx->dev, sizeof(*ctx->shim_regs64), GFP_KERNEL); if (!ctx->shim_regs64) { - return -ENOMEM; + ret = -ENOMEM; goto do_sst_cleanup; }