mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-13 12:58:20 +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);
|
||||
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user