summaryrefslogtreecommitdiff
path: root/drivers/mfd/cros_ec_dev.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-06-06 15:41:27 +0300
committerLee Jones <lee.jones@linaro.org>2019-06-17 12:51:15 +0300
commitcd49b84d61b2dfc0360c76d9e6be49f5116ba1a5 (patch)
tree9b8f387c39bca7c7c5f01111b03f58f7a5c8cea1 /drivers/mfd/cros_ec_dev.c
parenta188339ca5a396acc588e5851ed7e19f66b0ebd9 (diff)
downloadlinux-cd49b84d61b2dfc0360c76d9e6be49f5116ba1a5.tar.xz
mfd: stmfx: Uninitialized variable in stmfx_irq_handler()
The problem is that on 64bit systems then we don't clear the higher bits of the "pending" variable. So when we do: ack = pending & ~BIT(STMFX_REG_IRQ_SRC_EN_GPIO); if (ack) { the if (ack) condition relies on uninitialized data. The fix it that I've changed "pending" from an unsigned long to a u32. I changed "n" as well, because that's a number in the 0-10 range and it fits easily inside an int. We do need to add a cast to "pending" when we use it in the for_each_set_bit() loop, but that doesn't cause a problem, it's fine. Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/cros_ec_dev.c')
0 files changed, 0 insertions, 0 deletions