Skip to content
Commit cd49b84d authored by Dan Carpenter's avatar Dan Carpenter Committed by Lee Jones
Browse files

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: 06252ade ("mfd: Add ST Multi-Function eXpander (STMFX) core driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarAmelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent a188339c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment