From 9b209c4552779edb86221787fb8681dd212e3a0c Mon Sep 17 00:00:00 2001 From: Mohit Aggarwal Date: Sat, 22 Apr 2017 10:49:18 +0530 Subject: diag: dci: Add protection while querying event status Currently, protection is missing when querying event status due to which already removed dci client entry might be accessed. This patch takes care of issue by taking proper locking. CRs-Fixed: 2015892 Change-Id: I4195c4c6198d85e96559f1728d74419527a76bc5 Signed-off-by: Mohit Aggarwal --- drivers/char/diag/diagchar_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/char/diag/diagchar_core.c b/drivers/char/diag/diagchar_core.c index 574a13d..9a5f196 100644 --- a/drivers/char/diag/diagchar_core.c +++ b/drivers/char/diag/diagchar_core.c @@ -2336,7 +2336,9 @@ long diagchar_ioctl(struct file *filp, mutex_unlock(&driver->dci_mutex); break; case DIAG_IOCTL_DCI_EVENT_STATUS: + mutex_lock(&driver->dci_mutex); result = diag_ioctl_dci_event_status(ioarg); + mutex_unlock(&driver->dci_mutex); break; case DIAG_IOCTL_DCI_CLEAR_LOGS: mutex_lock(&driver->dci_mutex); -- cgit v1.1