Unverified Commit 4ff0e9f0 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!6603 [sync] PR-6520: firmware: arm_scmi: Fix double free in SMC transport cleanup path

parents 60273d1e 97bfd81f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -95,6 +95,13 @@ static int smc_chan_free(int id, void *p, void *data)
	cinfo->transport_info = NULL;
	scmi_info->cinfo = NULL;

	/*
	* 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;

	scmi_free_channel(cinfo, data, id);

	return 0;