summaryrefslogtreecommitdiffstats
path: root/libgralloc/framebuffer.cpp
diff options
context:
space:
mode:
authorNaseer Ahmed <naseer@codeaurora.org>2013-07-16 12:47:21 -0400
committerNaseer Ahmed <naseer@codeaurora.org>2013-07-16 12:47:21 -0400
commit473986c5c81169a23f1ebfeef7cc2b2f5aae1273 (patch)
treec3ac136dfa0a586df13a0e3a3667afdd173beb6f /libgralloc/framebuffer.cpp
parent21028318fd3eb2e16126835218f1e1056c7510b3 (diff)
downloadandroid_hardware_qcom_display-473986c5c81169a23f1ebfeef7cc2b2f5aae1273.tar.gz
android_hardware_qcom_display-473986c5c81169a23f1ebfeef7cc2b2f5aae1273.tar.bz2
android_hardware_qcom_display-473986c5c81169a23f1ebfeef7cc2b2f5aae1273.zip
gralloc: Default to an error value for mapFrameBuffer
We do further operations in fb_device_open based on the result of mapFrameBuffer. However, if mapFrameBuffer is never done, we could end up with a random crash when using the info values in fb_device_open. Defaulting to an error value avoids this. Change-Id: I1e51f814611a3f2eb73f36d75e14d8725ca98474
Diffstat (limited to 'libgralloc/framebuffer.cpp')
-rw-r--r--libgralloc/framebuffer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp
index 185119686..3109303fd 100644
--- a/libgralloc/framebuffer.cpp
+++ b/libgralloc/framebuffer.cpp
@@ -336,7 +336,7 @@ int mapFrameBufferLocked(struct private_module_t* module)
static int mapFrameBuffer(struct private_module_t* module)
{
- int err = 0;
+ int err = -1;
char property[PROPERTY_VALUE_MAX];
if((property_get("debug.gralloc.map_fb_memory", property, NULL) > 0) &&
(!strncmp(property, "1", PROPERTY_VALUE_MAX ) ||