diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2017-08-11 14:44:55 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2017-08-14 21:11:19 +0200 |
commit | 984277a041d5ee4a65aaadf0307d67a7c401e11c (patch) | |
tree | 38707bc9a7f6a50e31aefd608318fc04be48888a /drivers/i2c/busses/i2c-jz4780.c | |
parent | a23318feeff662c8d25d21623daebdd2e55ec221 (diff) |
i2c: designware: Fix oops from i2c_dw_irq_handler_slave
When i2c-designware is initialized in slave mode the
i2c-designware-slave.c: i2c_dw_irq_handler_slave() can hit a NULL
pointer dereference when I2C slave backend is not registered but code is
accessing the struct dw_i2c_dev.slave without testing is it NULL.
We might get spurious interrupts from other devices or from IRQ core
during unloading the driver when CONFIG_DEBUG_SHIRQ is set. Existing
check for enable and IRQ status is not enough since device can be power
gated and those bits may read 1.
Fix this by handling the interrupt only when also struct dw_i2c_dev.slave
is set.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-jz4780.c')
0 files changed, 0 insertions, 0 deletions