Skip to content

Commit 88c31d2

Browse files
Dan Carpenterlynxeye-dev
authored andcommitted
drm/etnaviv: fix error code in event_alloc()
There are two "ret" variables declared in this function so setting "ret = -EBUSY;" sets the wrong one. The function ends up returning an uninitialized variable. Fixes: f098f9b ("drm/etnaviv: move runtime PM handling to events") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
1 parent 9ec2afd commit 88c31d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gpu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,18 +1158,18 @@ static int event_alloc(struct etnaviv_gpu *gpu, unsigned nr_events,
11581158
int ret;
11591159

11601160
for (i = 0; i < nr_events; i++) {
1161-
unsigned long ret;
1161+
unsigned long remaining;
11621162

1163-
ret = wait_for_completion_timeout(&gpu->event_free, timeout);
1163+
remaining = wait_for_completion_timeout(&gpu->event_free, timeout);
11641164

1165-
if (!ret) {
1165+
if (!remaining) {
11661166
dev_err(gpu->dev, "wait_for_completion_timeout failed");
11671167
ret = -EBUSY;
11681168
goto out;
11691169
}
11701170

11711171
acquired++;
1172-
timeout = ret;
1172+
timeout = remaining;
11731173
}
11741174

11751175
spin_lock(&gpu->event_spinlock);

0 commit comments

Comments
 (0)