Re: [PATCH] irqchip: ti-sci-inta: Fix kernel crash if irq_create_fwspec_mapping fail

2019-06-04 Thread Marc Zyngier
On 04/06/2019 11:17, Peter Ujfalusi wrote: > irq_create_fwspec_mapping() can fail, returning 0 as parent_virq. In this > case vint_desc is going to be NULL in ti_sci_inta_alloc_irq() which will > cause NULL pointer dereference. > > Also note that irq_create_fwspec_mapping() returns 'unsigned int'

[PATCH] irqchip: ti-sci-inta: Fix kernel crash if irq_create_fwspec_mapping fail

2019-06-04 Thread Peter Ujfalusi
irq_create_fwspec_mapping() can fail, returning 0 as parent_virq. In this case vint_desc is going to be NULL in ti_sci_inta_alloc_irq() which will cause NULL pointer dereference. Also note that irq_create_fwspec_mapping() returns 'unsigned int' so the check '<=' was wrong. Use -EINVAL if irq_crea