]> git.dujemihanovic.xyz Git - linux.git/commitdiff
ata: sata_gemini: Check clk_enable() result
authorChen Ni <nichen@iscas.ac.cn>
Wed, 3 Apr 2024 04:33:49 +0000 (04:33 +0000)
committerDamien Le Moal <dlemoal@kernel.org>
Thu, 4 Apr 2024 03:42:00 +0000 (12:42 +0900)
The call to clk_enable() in gemini_sata_start_bridge() can fail.
Add a check to detect such failure.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
drivers/ata/sata_gemini.c

index 400b22ee99c33affba7b25ae46de0a2014bfd71f..4c270999ba3ccd9dd70175b02886998cc47e99a9 100644 (file)
@@ -200,7 +200,10 @@ int gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge)
                pclk = sg->sata0_pclk;
        else
                pclk = sg->sata1_pclk;
-       clk_enable(pclk);
+       ret = clk_enable(pclk);
+       if (ret)
+               return ret;
+
        msleep(10);
 
        /* Do not keep clocking a bridge that is not online */