Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/ls-scfg-msi: Fix NULL dereference in error handling

The call to irq_domain_remove(msi_data->parent); was accidentally left
behind during a code refactor. It's not necessary to free
"msi_data->parent" because it is NULL and, in fact, trying to free it
will lead to a NULL pointer dereference. Delete the unnecessary code.

Fixes: 94b59d5f567a ("irqchip/ls-scfg-msi: Switch to use msi_create_parent_irq_domain()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/all/15059507-6422-4333-94ca-e8e8840bd289@sabinyo.mountain

authored by

Dan Carpenter and committed by
Thomas Gleixner
aabf4ff0 94b59d5f

-1
-1
drivers/irqchip/irq-ls-scfg-msi.c
··· 226 226 msi_data->parent = msi_create_parent_irq_domain(&info, &ls_scfg_msi_parent_ops); 227 227 if (!msi_data->parent) { 228 228 dev_err(&msi_data->pdev->dev, "failed to create MSI domain\n"); 229 - irq_domain_remove(msi_data->parent); 230 229 return -ENOMEM; 231 230 } 232 231