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

clocksource/drivers/stm32: Fix error return code

Return an error code on failure.

Problem found using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: kernel-janitors@vger.kernel.org
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lkml.kernel.org/r1528640655-18948-3-git-send-email-Julia.Lawall@lip6.fr


authored by

Julia Lawall and committed by
Thomas Gleixner
a26ed66c c60c32a5

+3 -1
+3 -1
drivers/clocksource/timer-stm32.c
··· 304 304 305 305 to->private_data = kzalloc(sizeof(struct stm32_timer_private), 306 306 GFP_KERNEL); 307 - if (!to->private_data) 307 + if (!to->private_data) { 308 + ret = -ENOMEM; 308 309 goto deinit; 310 + } 309 311 310 312 rstc = of_reset_control_get(node, NULL); 311 313 if (!IS_ERR(rstc)) {