mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
mfd: tps65217: Fix NULL pointer dereference on IRQ init failure
tps65217_probe() ignores the return value of tps65217_irq_init(), so
when the irq domain creation fails the probe still completes and the
driver ends up bound with a NULL tps->irq_domain. Unloading the
module then makes tps65217_remove() call irq_domain_remove() on the
NULL pointer and oops the kernel. On top of that, irq_find_mapping()
may fall back to the default irq domain and dispose of mappings that
belong to other interrupt controllers.
Check the return value and abort the probe on failure so the error
is reported and no inconsistent state is left for removal.
Fixes: 6556bdacf6 ("mfd: tps65217: Add support for IRQs")
Cc: stable@vger.kernel.org
Signed-off-by: Radiy Zhambakiev <r.zhambakiev@prosoftsystems.ru>
Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20261002113624.178588-2-r.zhambakiev@prosoftsystems.ru
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
parent
4c06f36596
commit
0473a5b066
|
|
@ -333,7 +333,9 @@ static int tps65217_probe(struct i2c_client *client)
|
|||
}
|
||||
|
||||
if (client->irq) {
|
||||
tps65217_irq_init(tps, client->irq);
|
||||
ret = tps65217_irq_init(tps, client->irq);
|
||||
if (ret)
|
||||
return ret;
|
||||
} else {
|
||||
int i;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user