Message ID | 20240910084856.2355123-2-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 ea1caf70e8df9..2d43915203370 100644 --- a/drivers/firmware/arm_scmi/smc.c +++ b/drivers/firmware/arm_scmi/smc.c @@ -130,6 +130,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; + } + cinfo->transport_info = NULL; scmi_info->cinfo = NULL;