-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path002_cec.patch
29 lines (26 loc) · 944 Bytes
/
002_cec.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
commit b6b72f40ec3b9d7faa0e37e87c3509848928746c
Author: wolfgar <[email protected]>
Date: Fri Sep 12 03:05:22 2014 +0200
Flush pending events at close
diff --git a/drivers/mxc/hdmi-cec/mxc_hdmi-cec.c b/drivers/mxc/hdmi-cec/mxc_hdmi-cec.c
index 88670bd..f8b3f7a 100644
--- a/drivers/mxc/hdmi-cec/mxc_hdmi-cec.c
+++ b/drivers/mxc/hdmi-cec/mxc_hdmi-cec.c
@@ -466,11 +466,18 @@ static long hdmi_cec_ioctl(struct file *filp, u_int cmd,
*/
static int hdmi_cec_release(struct inode *inode, struct file *filp)
{
+ struct hdmi_cec_event *event, *tmp_event;
mutex_lock(&hdmi_cec_data.lock);
if (open_count) {
open_count = 0;
hdmi_cec_data.cec_state = false;
hdmi_cec_data.Logical_address = 15;
+
+ /* Flush eventual events which have not been read by user space */
+ list_for_each_entry_safe(event, tmp_event, &head, list) {
+ list_del(&event->list);
+ vfree(event);
+ }
}
mutex_unlock(&hdmi_cec_data.lock);