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

accel/rocket: Fix some error checking in rocket_core_init()

The problem is that pm_runtime_get_sync() can return 1 on success so
checking for zero doesn't work. Use the pm_runtime_resume_and_get()
function instead. The pm_runtime_resume_and_get() function does
additional cleanup as well so that's a bonus as well.

Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://lore.kernel.org/r/aKcRW6fsRP_o5C_y@stanley.mountain

authored by

Dan Carpenter and committed by
Tomeu Vizoso
09e6d39c 78e39995

+1 -1
+1 -1
drivers/accel/rocket/rocket_core.c
··· 74 74 75 75 pm_runtime_enable(dev); 76 76 77 - err = pm_runtime_get_sync(dev); 77 + err = pm_runtime_resume_and_get(dev); 78 78 if (err) { 79 79 rocket_job_fini(core); 80 80 return err;