projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab261e1
)
udev: free fd before return in accelerometer.c
author
Lukas Nykryn
<lnykryn@redhat.com>
Fri, 21 Sep 2012 11:03:00 +0000
(13:03 +0200)
committer
Kay Sievers
<kay@vrfy.org>
Sun, 23 Sep 2012 12:24:44 +0000
(14:24 +0200)
src/udev/accelerometer/accelerometer.c
patch
|
blob
|
history
diff --git
a/src/udev/accelerometer/accelerometer.c
b/src/udev/accelerometer/accelerometer.c
index
b8ed7b8
..
67fed27
100644
(file)
--- a/
src/udev/accelerometer/accelerometer.c
+++ b/
src/udev/accelerometer/accelerometer.c
@@
-205,8
+205,10
@@
static void test_orientation(struct udev *udev,
r = read(fd, ev, sizeof(struct input_event) * 64);
- if (r < (int) sizeof(struct input_event))
+ if (r < (int) sizeof(struct input_event)) {
+ close(fd);
return;
+ }
for (i = 0; i < r / (int) sizeof(struct input_event); i++) {
if (got_syn == 1) {