Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1042372rwb; Wed, 26 Jul 2023 06:52:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlGjD2C/RY5ca37Gwxvhe17kwjjqoUX//bjy7KdH3jryvDCjYlkN6+/r9Gf/xdiDsoDsSvqh X-Received: by 2002:aa7:d285:0:b0:522:3fc6:91e6 with SMTP id w5-20020aa7d285000000b005223fc691e6mr1768028edq.9.1690379549412; Wed, 26 Jul 2023 06:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690379549; cv=none; d=google.com; s=arc-20160816; b=yXxy1SRIlT+UqsgiGeL57/yz6nH4KYU0apjYqeoGhApaeHBBW3seRL940+OR7r6ild e9WNK0dY0mUmKE50J2ARupfJU4ZH3y2NeYrGfnZojm7GcGZeE6M3n+egQLJKd21qLGw4 DMOoCFph1713XA/lGGQ2DQVDbORBD64QyhIpY5FJJPd1KJCwMZ/gPBXv8yUaGDW03Wzp R4f1lSu+zCsYrqJbHYLbo27KIwoUSmi94a8XhfvFUPgOv9B2/4gim8RPr8BOHvoFFEID PYstLB2U6ySjgssp1PvTOkARVVbYbtl9Cs3XsFs8cfXi0ibsdQuGmlsjXazDESavAIYQ QpaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=VbvvJuUsDhhMLc0Q9oqh53cbxVE2E2Kk8CdLOl5kv+4=; fh=TbFbcJS8/PeEfbwAKAkJHNk63HE/EwJlMtnZQIkx6aE=; b=MamBTZShV3Ha9PMW/twVOB6XzVH7qF/6VTUyI2mQ/wYr0imOQJeLTdeLePwgYIxG6v ThiqkFJyQeI1GGfBOjTIy3J4/MlxaErfTbDM7UhRsmVjPlwQYe9BjNbs7KeWFk4RrXlr 5sDauTB+nXQ2sVAY9d3KLUTF0C7huyEHjheTmGml7Q7YAiyCnwEjyONHln9woBDNx9tT oWDaEkxEDsSw9H6DGgyryQavF7Ne5OUIqBwofwvYRTw7rJqyxOuNRTZ2hOZGCa9MYr4V Io79aFZGYpVClZrSw7GS4QVp5fvgv7+bM3okmj/QDGxh4AXkYYXWXbFm1a7/8GZz6Wdj L92w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=jnJhbaaJ; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020aa7d1c6000000b0051e226c4e6dsi9523991edp.278.2023.07.26.06.51.51; Wed, 26 Jul 2023 06:52:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=jnJhbaaJ; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231579AbjGZNa2 (ORCPT + 99 others); Wed, 26 Jul 2023 09:30:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbjGZNa1 (ORCPT ); Wed, 26 Jul 2023 09:30:27 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 81A31AC for ; Wed, 26 Jul 2023 06:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=VbvvJuUsDhhMLc0Q9o qh53cbxVE2E2Kk8CdLOl5kv+4=; b=jnJhbaaJnGefe6mnzgehJl1dJQPMIzC1dW 62ro8J+IrnD4jeFD1oKvxJMWrb5GBZtHtgV9kPpGJABNSQbKQq5UKjEpIbjEJAkA HKBq9AglkdZtwd2t6xi9JL23cEyXkVsOhNWtk1mv2etOAy5dFYTVBoIT12QfTgV+ vJp5c4bDk= Received: from localhost.localdomain (unknown [202.112.113.212]) by zwqz-smtp-mta-g2-0 (Coremail) with SMTP id _____wAndqbaH8FkaLRyBQ--.6950S4; Wed, 26 Jul 2023 21:30:07 +0800 (CST) From: Yuanjun Gong To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org Cc: Yuanjun Gong Subject: [PATCH 1/1] bluetooth: nokia: fix value check in nokia_bluetooth_serdev_probe() Date: Wed, 26 Jul 2023 21:30:00 +0800 Message-Id: <20230726133000.20417-1-ruc_gongyuanjun@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: _____wAndqbaH8FkaLRyBQ--.6950S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrtF1xAw4rXr1DJw4UZw15twb_yoWfKrgE9a 97ZryfGF4jgrn3A3WY9F1UZrWIga4ruFnaqw1Iq3yYvr9rur9rJrsrXrsxtrW7urZ7Kr90 yw45u3WSkr4rGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRN6pBDUUUUU== X-Originating-IP: [202.112.113.212] X-CM-SenderInfo: 5uxfsw5rqj53pdqm30i6rwjhhfrp/1tbiUQO45WDESbvfZAAAsi X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L4,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org in nokia_bluetooth_serdev_probe(), check the return value of clk_prepare_enable() and return the error code if clk_prepare_enable() returns an unexpected value. Fixes: 7bb318680e86 ("Bluetooth: add nokia driver") Signed-off-by: Yuanjun Gong --- drivers/bluetooth/hci_nokia.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_nokia.c b/drivers/bluetooth/hci_nokia.c index 05f7f6de6863..97da0b2bfd17 100644 --- a/drivers/bluetooth/hci_nokia.c +++ b/drivers/bluetooth/hci_nokia.c @@ -734,7 +734,11 @@ static int nokia_bluetooth_serdev_probe(struct serdev_device *serdev) return err; } - clk_prepare_enable(sysclk); + err = clk_prepare_enable(sysclk); + if (err) { + dev_err(dev, "could not enable sysclk: %d", err); + return err; + } btdev->sysclk_speed = clk_get_rate(sysclk); clk_disable_unprepare(sysclk); -- 2.17.1