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: <20190114093258.28431-1-markz@nvidia.com>
Date:   Mon, 14 Jan 2019 17:32:58 +0800
From:   Mark Zhang <markz@...dia.com>
To:     <broonie@...nel.org>, <gregkh@...uxfoundation.org>,
        <rafael@...nel.org>, <linux-kernel@...r.kernel.org>
CC:     <linux-tegra@...r.kernel.org>, Mark Zhang <markz@...dia.com>,
        Laxman Dewangan <ldewangan@...dia.com>,
        Jinyoung Park <jinyoungp@...dia.com>,
        Venkat Reddy Talla <vreddytalla@...dia.com>
Subject: [PATCH] regmap-irq: do not write mask register if mask_base is zero

If client have not provided the mask base register then do not
write into the mask register.

Signed-off-by: Laxman Dewangan <ldewangan@...dia.com>
Signed-off-by: Jinyoung Park <jinyoungp@...dia.com>
Signed-off-by: Venkat Reddy Talla <vreddytalla@...dia.com>
Signed-off-by: Mark Zhang <markz@...dia.com>
---
 drivers/base/regmap/regmap-irq.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index d2d0014b0d23..330c1f7e9665 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -108,6 +108,9 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
 	 * suppress pointless writes.
 	 */
 	for (i = 0; i < d->chip->num_regs; i++) {
+		if (!d->chip->mask_base)
+			continue;
+
 		reg = d->chip->mask_base +
 			(i * map->reg_stride * d->irq_reg_stride);
 		if (d->chip->mask_invert) {
@@ -588,6 +591,9 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
 	/* Mask all the interrupts by default */
 	for (i = 0; i < chip->num_regs; i++) {
 		d->mask_buf[i] = d->mask_buf_def[i];
+		if (!chip->mask_base)
+			continue;
+
 		reg = chip->mask_base +
 			(i * map->reg_stride * d->irq_reg_stride);
 		if (chip->mask_invert)
-- 
2.19.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ