Message ID | 20240910023754.2163657-3-hui.wang@canonical.com |
---|---|
State | New |
Headers | show |
Series | CVE-2024-26893 | expand |
diff --git a/drivers/firmware/arm_scmi/smc.c b/drivers/firmware/arm_scmi/smc.c index cbe025d4cb612..907b19bdccd90 100644 --- a/drivers/firmware/arm_scmi/smc.c +++ b/drivers/firmware/arm_scmi/smc.c @@ -131,6 +131,15 @@ static int smc_chan_free(int id, void *p, void *data) struct scmi_chan_info *cinfo = p; struct scmi_smc *scmi_info = cinfo->transport_info; + /* + * Different protocols might share the same chan info, so a previous + * smc_chan_free call might have already freed the structure. + */ + if (!scmi_info) { + scmi_free_channel(cinfo, data, id); + return 0; + } + /* Ignore any possible further reception on the IRQ path */ if (scmi_info->irq > 0) free_irq(scmi_info->irq, scmi_info);