diff options
author | Antonio Argenziano <antonio.argenziano@intel.com> | 2018-05-09 14:18:51 -0700 |
---|---|---|
committer | Antonio Argenziano <antonio.argenziano@intel.com> | 2018-05-09 15:02:31 -0700 |
commit | 35f08c12aa216d5b62a5b9984b575cee6905098f (patch) | |
tree | 48c9fae21886bff7dbc9b7783c4039689329f863 /lib/igt_dummyload.c | |
parent | cffe915716f02ecd7561bdd1fa252b8a077abeda (diff) |
lib/igt_dummyload: Fix possible NULL pointer dereference
Make sure that at least one of the 'mmap' functions returns a valid pointer to
avoid dereferencing a NULL pointer later on. (Issue found via coverity)
v2:
- Use the version of the mapping function that will assert on fail
(Chris).
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_dummyload.c')
-rw-r--r-- | lib/igt_dummyload.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c index ba917ba5..3809b4e6 100644 --- a/lib/igt_dummyload.c +++ b/lib/igt_dummyload.c @@ -123,7 +123,7 @@ emit_recursive_batch(igt_spin_t *spin, int fd, uint32_t ctx, unsigned engine, batch = __gem_mmap__wc(fd, obj[BATCH].handle, 0, BATCH_SIZE, PROT_WRITE); if (!batch) - batch = __gem_mmap__gtt(fd, obj[BATCH].handle, + batch = gem_mmap__gtt(fd, obj[BATCH].handle, BATCH_SIZE, PROT_WRITE); gem_set_domain(fd, obj[BATCH].handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); |