summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/arm_scmi/smc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firmware/arm_scmi/smc.c')
-rw-r--r--drivers/firmware/arm_scmi/smc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scmi/smc.c b/drivers/firmware/arm_scmi/smc.c
index ac0bd51ef..42ea308a2 100644
--- a/drivers/firmware/arm_scmi/smc.c
+++ b/drivers/firmware/arm_scmi/smc.c
@@ -171,6 +171,13 @@ 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)
+ return 0;
+
/* Ignore any possible further reception on the IRQ path */
if (scmi_info->irq > 0)
free_irq(scmi_info->irq, scmi_info);