From patchwork Fri Dec 17 03:13:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiasheng Jiang X-Patchwork-Id: 12683601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F69BC433F5 for ; Fri, 17 Dec 2021 03:14:53 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 406591F2E; Fri, 17 Dec 2021 04:14:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 406591F2E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1639710891; bh=7jSYj782gL0/5CA6LntfRj/5DXgHUUdRK40z9WFMzg8=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=aJkeeNtnV/fN126A1dijGE9nlzsToal8onC10EqpMp3H+iv4xWJGBYubpKZSj8DMv wnh9WnZmNkClh/YQ3h9kSTJelZuiWJv0W6v9xZEnTDSUTVTtSU+5pH6XHB/MfzhrOh NdO4pYqzN1qWAYmqkAUXVklODwgU/HWRva2RsHus= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C1469F80148; Fri, 17 Dec 2021 04:14:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 29D03F8014D; Fri, 17 Dec 2021 04:13:54 +0100 (CET) Received: from cstnet.cn (smtp21.cstnet.cn [159.226.251.21]) by alsa1.perex.cz (Postfix) with ESMTP id 17C31F800B0 for ; Fri, 17 Dec 2021 04:13:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 17C31F800B0 Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-01 (Coremail) with SMTP id qwCowAAnvqZeALxhWsO5Aw--.18722S2; Fri, 17 Dec 2021 11:13:35 +0800 (CST) From: Jiasheng Jiang To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, kuninori.morimoto.gx@renesas.com, shengjiu.wang@nxp.com, daniel.baluta@nxp.com Subject: [PATCH] ASoC: wm8962: potential use of error pointer Date: Fri, 17 Dec 2021 11:13:33 +0800 Message-Id: <20211217031333.493777-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: qwCowAAnvqZeALxhWsO5Aw--.18722S2 X-Coremail-Antispam: 1UD129KBjvdXoWrZr45XrWUCFWfGw1fWrWUCFg_yoWxKrb_Gw 48u3yqvr9FgF1Svr9rXr4Y9a1FqF1fC3WUKwnaqFsxJFyUCrs5JwsrGrn3CrsrWw48ZF1U GFnF9r47Jr1UGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbVkFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s 1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0 cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8Jw ACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2ka 0xkIwI1lc2xSY4AK67AK6r48MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r 4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF 67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2I x0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Wr1j6rW3Jr1lIxAI cVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2Kf nxnUUI43ZEXa7VUjQBMtUUUUU== X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Jiasheng Jiang , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The return value of devm_clk_get() needs to be checked. To avoid use of error pointer in case of the failure of alloc. Fixes: d74e9e7090ae ("ASoC: wm8962: Add device tree binding") Signed-off-by: Jiasheng Jiang --- sound/soc/codecs/wm8962.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 34080f497584..66693bf17763 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -3540,6 +3540,8 @@ static int wm8962_set_pdata_from_of(struct i2c_client *i2c, } pdata->mclk = devm_clk_get(&i2c->dev, NULL); + if (IS_ERR(pdata->mclk)) + return -ENOMEM; return 0; }