diff options
author | John Stultz <john.stultz@linaro.org> | 2017-03-28 20:48:36 -0700 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2017-03-29 07:57:33 -0500 |
commit | 95c1cfb06d41535841520e3ea8f625252fa576b9 (patch) | |
tree | a5ca350932e39c63873be9ba4c4d2809a62b5b47 /gralloc.cpp | |
parent | e4017f7e1c07edc51d16735c7a5491c4253f2777 (diff) | |
download | gbm_gralloc-95c1cfb06d41535841520e3ea8f625252fa576b9.tar.gz gbm_gralloc-95c1cfb06d41535841520e3ea8f625252fa576b9.tar.xz |
gbm_gralloc: Remove the invalid int cast and assignment in gbm_mod_perform()
In gbm_mod_perform(), for the cmd GRALLOC_MODULE_PERFORM_GET_USAGE,
the code takes the third argument, casts it as an int* and then writes
a zero into what the pointer points to.
The problem with this is that the third argument to that function is
actually a native_handle_t, so writing zero to the first int in that
structure ends up overwriting the version value, causing the
native_handle_t code to see the value as corrupt.
This results in lots of warnings and leaked fds.
Change-Id: If64770c164557b467f76ca97ddc182565730d394
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Vishal Bhoj <vishal.bhoj@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'gralloc.cpp')
-rw-r--r-- | gralloc.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/gralloc.cpp b/gralloc.cpp index 01a1c6f..ec7638f 100644 --- a/gralloc.cpp +++ b/gralloc.cpp @@ -117,8 +117,6 @@ static int gbm_mod_perform(const struct gralloc_module_t *mod, int op, ...) /* TODO: This is a stub and should be implemented fully */ case GRALLOC_MODULE_PERFORM_GET_USAGE: { - int *buffer_usage = va_arg(args, int *); - *buffer_usage = 0; err = 0; } break; |