[PATCH 01/10] iommu/arm-smmu: Drop if with an always false condition

Joerg Roedel joro at 8bytes.org
Tue Mar 28 06:42:21 PDT 2023


On Tue, Mar 21, 2023 at 09:41:16AM +0100, Uwe Kleine-König wrote:
> The remove and shutdown callback are only called after probe completed
> successfully. In this case platform_set_drvdata() was called with a
> non-NULL argument and so smmu is never NULL. Other functions in this
> driver also don't check for smmu being non-NULL before using it.
> 
> Also note that returning an error code from a remove callback doesn't
> result in the device staying bound. It's still removed and devm allocated
> resources are freed (among others *smmu and the register mapping). So
> after an early exit to iommu device stayed around and using it probably
> oopses.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
>  drivers/iommu/arm/arm-smmu/arm-smmu.c | 6 ------
>  1 file changed, 6 deletions(-)

Need an ack or review by either Will or Robin on this patch.

Regards,

	Joerg



More information about the linux-arm-kernel mailing list