OSDN Git Service
(root)
/
android-x86
/
hardware-libsensors.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2b9611
)
w500: fix loop segfault in input devices list
author
Tanguy Pruvot
<tanguy.pruvot@gmail.com>
Fri, 13 Jun 2014 21:44:41 +0000
(23:44 +0200)
committer
Chih-Wei Huang
<cwhuang@linux.org.tw>
Mon, 23 Jun 2014 15:58:10 +0000
(23:58 +0800)
w500_sensor.c
patch
|
blob
|
history
diff --git
a/w500_sensor.c
b/w500_sensor.c
index
a945acb
..
d1a8839
100644
(file)
--- a/
w500_sensor.c
+++ b/
w500_sensor.c
@@
-67,8
+67,7
@@
static int open_accel_sensor(void)
* for our driver.
*/
ALOGD("%s[%i] Looping over all eventXX...", __func__, __LINE__);
- do {
- de = readdir(dir);
+ while ((de = readdir(dir))) {
if (de->d_name[0] != 'e')
continue;
memset(name, 0, PATH_MAX);
@@
-101,7
+100,7
@@
static int open_accel_sensor(void)
}
close(fd);
- }
while (de != NULL);
+ }
ALOGD("%s[%i] stop loop and closing directory",
__func__, __LINE__);