From mboxrd@z Thu Jan 1 00:00:00 1970 From: chetannanda@gmail.com (Chetan Nanda) Date: Thu, 10 Mar 2016 14:59:31 +0530 Subject: owner not checked in mutex_unlock Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi, As per book (Linux kernel development) "Whoever locked a mutex must unlock it.That is, you cannot lock a mutex in one context and then unlock it in another " but 'mutex_unlock' code is not checking the owner field at all. Also, I tried with locking the mutex from normal process context and unlocking from separate context (work context) and it is allowed without any error from kernel. Is it the mutex user responsibility to keep track of it? Ideally mutex_unlock should check if owner is same as current? Thanks, Chetan Nanda