mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-21 01:54:51 +08:00
drm/i915/selftests: fix null pointer dereference on pointer data
In the case where data fails to be allocated the error exit path is
via label 'out' where data is dereferenced in a for-loop. Fix this
by exiting via the label 'out_file' instead to avoid the null pointer
dereference.
Addresses-Coverity: ("Dereference after null check")
Fixes: 50d16d44cc
("drm/i915/selftests: Exercise context switching in parallel")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191009100024.23077-1-colin.king@canonical.com
This commit is contained in:
parent
41f0bc49f7
commit
d46e137c44
@ -263,7 +263,7 @@ static int live_parallel_switch(void *arg)
|
||||
if (!data) {
|
||||
i915_gem_context_unlock_engines(ctx);
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
goto out_file;
|
||||
}
|
||||
|
||||
m = 0; /* Use the first context as our template for the engines */
|
||||
|
Loading…
Reference in New Issue
Block a user