[PATCH] iommu/tegra241-cmdqv: Skip CMD_SYNC flush during remove

Jason Gunthorpe jgg at ziepe.ca
Fri May 29 04:53:35 PDT 2026


On Fri, May 29, 2026 at 10:10:52AM +0100, Shameer Kolothum wrote:

> @@ -789,6 +794,13 @@ static void tegra241_cmdqv_remove(struct arm_smmu_device *smmu)
>  		container_of(smmu, struct tegra241_cmdqv, smmu);
>  	u16 idx;
>  
> +	/*
> +	 * tegra241_cmdqv_remove() is added to devres at the very beginning. So,
> +	 * at this point, devres has already freed the SMMU resources that this
> +	 * path must not access to avoid a UAF.
> +	 */
> +	cmdqv->removing = true;

Please don't add random bools to avoid devm bugs. Just don't use devm,
or maybe fix the devm ordering.. These ordering bugs are a well known
problem with using devm :(

Jason



More information about the linux-arm-kernel mailing list