video: fbdev: simplefb: Check before clk_put() not needed
authorYihao Han <hanyihao@vivo.com>
Thu, 2 Jun 2022 09:42:18 +0000 (02:42 -0700)
committerHelge Deller <deller@gmx.de>
Mon, 20 Jun 2022 18:22:16 +0000 (20:22 +0200)
clk_put() already checks the clk ptr using !clk and IS_ERR()
so there is no need to check it again before calling it.

Signed-off-by: Yihao Han <hanyihao@vivo.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/simplefb.c

index 2c198561c338f74fbb2e34a85aa22f70b36faa3b..f96ce8801be49c91130014e99af151a0854ca8c7 100644 (file)
@@ -237,8 +237,7 @@ static int simplefb_clocks_get(struct simplefb_par *par,
                if (IS_ERR(clock)) {
                        if (PTR_ERR(clock) == -EPROBE_DEFER) {
                                while (--i >= 0) {
-                                       if (par->clks[i])
-                                               clk_put(par->clks[i]);
+                                       clk_put(par->clks[i]);
                                }
                                kfree(par->clks);
                                return -EPROBE_DEFER;