Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1533091ybv; Thu, 20 Feb 2020 22:38:28 -0800 (PST) X-Google-Smtp-Source: APXvYqyPEczvBtZv7WHqy8u2LsgJeX4q+bdoMTH46CU22SogQYYyTyhHS7ZJdDDlmhqT+OJtJyRA X-Received: by 2002:a9d:4541:: with SMTP id p1mr27536247oti.199.1582267108328; Thu, 20 Feb 2020 22:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582267108; cv=none; d=google.com; s=arc-20160816; b=wdbdQAZ+WpLYt4wFAKRs3jn04fbJodtROueHugWhuBwdP8ZQjYEaTBYhsWX35co1Hj W4jBkfcP3jbmFN3/M2mkp7oE1cPe+MKRsGh925UVV0dEWf9N/Flz0xXOvIuJznyFvk94 VIWjMB19xJTW7cvMeHbiz/tQezfRQJArJ3+3ntYUZtVdhbV945fjuC2EIeRSpCjsz7BA WVzMPlAR3cWEphs1lKRwXKZn36QrStLPrH+3E335OuUU9Pfs9iDn9dMik7s/DpBi+06n EkQMA/k4xu2ms0dGuejv97krPKtAQpfvYu35gT7Whd9iMx2c1jfmjLEnEyNCpdBWFp5s MNbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=owNPInAhdv2MH0v5R4uFz/JhzBgpoKM/vEX+nzGHQ7Q=; b=UCxtWvE8zq4QNICQhzfLGyydaelgP2Vxn+3P00PPshUCRWUpKQTq+MPqVSfOfBqBB/ L1Ob8wUOTqqF/7c86k7BeBVv+Dhb6QnsI6djt53tBIUt0fI+ZMAJLuhOZRa+A/+dzGyz 17z9VNaHEmZDmEUddzr4a/8QODIm/cig8c+CueJQx36cqAL6S3wn4edxQZRzavEkITYF GfXm0fbEP1wAjHFr0vcoOFEPEgin8Q8g2ZjhzoUHYzQktZIT5pJYfnMoT5R8ggUdl7jD PvFz313sDZrPFfG3EyKuyYeVnGPXlAu5Ygfyf50Lp76QmBWKklOtYvOEgpOWhvxDCjSH bDrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si331080oir.71.2020.02.20.22.38.15; Thu, 20 Feb 2020 22:38:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726976AbgBUGiE (ORCPT + 99 others); Fri, 21 Feb 2020 01:38:04 -0500 Received: from inva021.nxp.com ([92.121.34.21]:44852 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726315AbgBUGiE (ORCPT ); Fri, 21 Feb 2020 01:38:04 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 064D0206BA3; Fri, 21 Feb 2020 07:38:02 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id ED5712022C5; Fri, 21 Feb 2020 07:37:54 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5BB064032D; Fri, 21 Feb 2020 14:37:42 +0800 (SGT) From: Anson Huang To: mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, leonard.crestez@nxp.com, peng.fan@nxp.com, yuehaibing@huawei.com, ping.bai@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] clk: imx: pll14xx: Return error if pll type is invalid Date: Fri, 21 Feb 2020 14:31:56 +0800 Message-Id: <1582266716-19821-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When pll type is invalid, ONLY output error message is NOT enough, should return error immediately. Signed-off-by: Anson Huang --- drivers/clk/imx/clk-pll14xx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c index 37e311e..a83bbbe 100644 --- a/drivers/clk/imx/clk-pll14xx.c +++ b/drivers/clk/imx/clk-pll14xx.c @@ -410,6 +410,8 @@ struct clk_hw *imx_clk_hw_pll14xx(const char *name, const char *parent_name, default: pr_err("%s: Unknown pll type for pll clk %s\n", __func__, name); + kfree(pll); + return ERR_PTR(-EINVAL); }; pll->base = base; -- 2.7.4