]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: nokia: fix value check in nokia_bluetooth_serdev_probe()
authorYuanjun Gong <ruc_gongyuanjun@163.com>
Wed, 26 Jul 2023 13:30:00 +0000 (21:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 08:46:55 +0000 (10:46 +0200)
[ Upstream commit e8b5aed31355072faac8092ead4938ddec3111fd ]

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 <ruc_gongyuanjun@163.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/hci_nokia.c

index 3539fd03f47eec45be42ed6b1be1a7c26b09ddba..474866448f181514e20edea0842ebd0c94ebfb34 100644 (file)
@@ -746,7 +746,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);