mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 20:25:38 +03:00
udev: free fd before return in accelerometer.c
This commit is contained in:
parent
ab261e1226
commit
9c513fe009
@ -205,8 +205,10 @@ static void test_orientation(struct udev *udev,
|
|||||||
|
|
||||||
r = read(fd, ev, sizeof(struct input_event) * 64);
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < r / (int) sizeof(struct input_event); i++) {
|
for (i = 0; i < r / (int) sizeof(struct input_event); i++) {
|
||||||
if (got_syn == 1) {
|
if (got_syn == 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user