lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e668b89.1c69fb81.d7e4f.0f61@mx.google.com>
Date:   Tue, 10 Mar 2020 00:01:28 +0530
From:   Rohit Sarkar <rohitsarkar5398@...il.com>
To:     linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     jic23@...nel.org, matt.ranostay@...sulko.com
Subject: [PATCH] iio: health: max30100: remove mlock usage

Use local lock instead of indio_dev's mlock.
The mlock was being used to protect local driver state thus using the
local lock is a better option here.

Signed-off-by: Rohit Sarkar <rohitsarkar5398@...il.com>
---
 drivers/iio/health/max30100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/health/max30100.c b/drivers/iio/health/max30100.c
index 84010501762d..8ddc4649547d 100644
--- a/drivers/iio/health/max30100.c
+++ b/drivers/iio/health/max30100.c
@@ -388,7 +388,7 @@ static int max30100_read_raw(struct iio_dev *indio_dev,
 		 * Temperature reading can only be acquired while engine
 		 * is running
 		 */
-		mutex_lock(&indio_dev->mlock);
+		mutex_lock(&data->lock);
 
 		if (!iio_buffer_enabled(indio_dev))
 			ret = -EAGAIN;
@@ -399,7 +399,7 @@ static int max30100_read_raw(struct iio_dev *indio_dev,
 
 		}
 
-		mutex_unlock(&indio_dev->mlock);
+		mutex_unlock(&data->lock);
 		break;
 	case IIO_CHAN_INFO_SCALE:
 		*val = 1;  /* 0.0625 */
-- 
2.23.0.385.gbc12974a89

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ