From patchwork Fri Jan 24 09:25:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA422C2D0DB for ; Fri, 24 Jan 2020 11:06:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90088214DB for ; Fri, 24 Jan 2020 11:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579863995; bh=AU+3PHiBmegkjPxZ+2mjUGrWNi3r28KFvYhIjRcevqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IFa7kG+VstzVPEtMhVinxXu/mXb2qCS12l2w/I/iGjeDWz5NFKNshFGb+jOpid+/X W0MfY9THxv6dXeNKlVY87HO74RU52Xgo71FeQs7EpV+PQ4ZFAKPvqOsVQO6vWGm6l9 DQ7bB8B5zSlA520/LC/7lBb33ikCZG4lNEVhaSJg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389107AbgAXLGX (ORCPT ); Fri, 24 Jan 2020 06:06:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:41042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730222AbgAXLGW (ORCPT ); Fri, 24 Jan 2020 06:06:22 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B49762071A; Fri, 24 Jan 2020 11:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579863981; bh=AU+3PHiBmegkjPxZ+2mjUGrWNi3r28KFvYhIjRcevqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qsh4qElagPzfzD/wmZSsOxdx3gy/74p865kPh9zOzc2lWzbD4bOan/+KqrUrump5/ SFE45IB8/iJMA3nHwB1pJjKGNkHe8oBtqtGi4/BAHk0LqNrgJeFKGwJou6mprle2q5 IZjJthaH0jVIG/JD3UuAWSkZeqboqiHnW3glMTnw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Agner , Daniel Baluta , Nicolin Chen , Fabio Estevam , Mark Brown , Sasha Levin Subject: [PATCH 4.19 138/639] ASoC: imx-sgtl5000: put of nodes if finding codec fails Date: Fri, 24 Jan 2020 10:25:08 +0100 Message-Id: <20200124093104.553478350@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Stefan Agner [ Upstream commit d9866572486802bc598a3e8576a5231378d190de ] Make sure to properly put the of node in case finding the codec fails. Fixes: 81e8e4926167 ("ASoC: fsl: add sgtl5000 clock support for imx-sgtl5000") Signed-off-by: Stefan Agner Reviewed-by: Daniel Baluta Acked-by: Nicolin Chen Reviewed-by: Fabio Estevam Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/imx-sgtl5000.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c index 9b9a7ec529055..4bd8da3a5f5b8 100644 --- a/sound/soc/fsl/imx-sgtl5000.c +++ b/sound/soc/fsl/imx-sgtl5000.c @@ -112,7 +112,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) codec_dev = of_find_i2c_device_by_node(codec_np); if (!codec_dev) { dev_err(&pdev->dev, "failed to find codec platform device\n"); - return -EPROBE_DEFER; + ret = -EPROBE_DEFER; + goto fail; } data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);