Skip to content

Commit a26ed66

Browse files
JuliaLawallKAGA-KOKO
authored andcommitted
clocksource/drivers/stm32: Fix error return code
Return an error code on failure. Problem found using Coccinelle. Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: [email protected] Cc: Maxime Coquelin <[email protected]> Cc: Alexandre Torgue <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/[email protected]
1 parent c60c32a commit a26ed66

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/clocksource/timer-stm32.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,10 @@ static int __init stm32_timer_init(struct device_node *node)
304304

305305
to->private_data = kzalloc(sizeof(struct stm32_timer_private),
306306
GFP_KERNEL);
307-
if (!to->private_data)
307+
if (!to->private_data) {
308+
ret = -ENOMEM;
308309
goto deinit;
310+
}
309311

310312
rstc = of_reset_control_get(node, NULL);
311313
if (!IS_ERR(rstc)) {

0 commit comments

Comments
 (0)