]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
serial: 8250_bcm2835aux: Add missing clk_disable_unprepare()
authorGuo Mengqi <guomengqi3@huawei.com>
Fri, 15 Jul 2022 02:33:12 +0000 (10:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:42:12 +0000 (14:42 +0200)
commitb6fe0365f1f1f74a0510179a1d95b40c83302e0d
tree39c6a31fd5f00b77bd7bca094fb18159a19cf865
parente0274da3ac318296fed503422ccda98ce67e99cb
serial: 8250_bcm2835aux: Add missing clk_disable_unprepare()

[ Upstream commit b9f1736e475dba0d6da48fdcb831248ab1597886 ]

The error path when get clock frequency fails in bcm2835aux_serial
driver does not correctly disable the clock.

This flaw was found using a static analysis tool "Hulk Robot", which
reported the following warning when analyzing linux-next/master:

    drivers/tty/serial/8250/8250_bcm2835aux.c:
    warning: clk_disable_unprepare_missing.cocci

The cocci script checks for the existence of clk_disable_unprepare()
paired with clk_prepare_enable().

Add the missing clk_disable_unprepare() to the error path.

Fixes: fcc446c8aa63 ("serial: 8250_bcm2835aux: Add ACPI support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Guo Mengqi <guomengqi3@huawei.com>
Link: https://lore.kernel.org/r/20220715023312.37808-1-guomengqi3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/8250/8250_bcm2835aux.c