Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mailbox: th1520: fix clock imbalance on probe failure

The purpose of the devm_add_action_or_reset() helper is to call the
action function in case adding an action ever fails so drop the clock
disable from the error path to avoid disabling the clocks twice.

Fixes: 5d4d263e1c6b ("mailbox: Introduce support for T-head TH1520 Mailbox driver")
Cc: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>

authored by

Johan Hovold and committed by
Jassi Brar
e3cee98f ff0e4d4c

+1 -3
+1 -3
drivers/mailbox/mailbox-th1520.c
··· 435 435 } 436 436 437 437 ret = devm_add_action_or_reset(dev, th1520_disable_clk, priv); 438 - if (ret) { 439 - clk_bulk_disable_unprepare(ARRAY_SIZE(priv->clocks), priv->clocks); 438 + if (ret) 440 439 return ret; 441 - } 442 440 443 441 /* 444 442 * The address mappings in the device tree align precisely with those