Commit 88c31d2d authored by Dan Carpenter's avatar Dan Carpenter Committed by Lucas Stach

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: f098f9b8 ("drm/etnaviv: move runtime PM handling to events")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
parent 9ec2afde
...@@ -1158,18 +1158,18 @@ static int event_alloc(struct etnaviv_gpu *gpu, unsigned nr_events, ...@@ -1158,18 +1158,18 @@ static int event_alloc(struct etnaviv_gpu *gpu, unsigned nr_events,
int ret; int ret;
for (i = 0; i < nr_events; i++) { for (i = 0; i < nr_events; i++) {
unsigned long ret; unsigned long remaining;
ret = wait_for_completion_timeout(&gpu->event_free, timeout); remaining = wait_for_completion_timeout(&gpu->event_free, timeout);
if (!ret) { if (!remaining) {
dev_err(gpu->dev, "wait_for_completion_timeout failed"); dev_err(gpu->dev, "wait_for_completion_timeout failed");
ret = -EBUSY; ret = -EBUSY;
goto out; goto out;
} }
acquired++; acquired++;
timeout = ret; timeout = remaining;
} }
spin_lock(&gpu->event_spinlock); spin_lock(&gpu->event_spinlock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment