[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1308569158-22484-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Date: Mon, 20 Jun 2011 12:25:58 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Samuel Ortiz <sameo@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org, patches@...nsource.wolfsonmicro.com,
Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: [PATCH] mfd: Ensure value written by wm831x_set_bits() is within the mask
Purely for defensiveness.
Signed-off-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
---
drivers/mfd/wm831x-core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index 02c9109..6c53376 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -260,7 +260,7 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
goto out;
r &= ~mask;
- r |= val;
+ r |= val & mask;
ret = wm831x_write(wm831x, reg, 2, &r);
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists