From: Andy Shevchenko Date: Mon, 25 Mar 2024 12:33:02 +0000 (+0200) Subject: ACPI: scan: Use standard error checking pattern X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=602401e32847f90c513df4a34bcac4dd6b02dd8d;p=linux.git ACPI: scan: Use standard error checking pattern Check for an error and return it as it's the usual way to handle this. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index e64e1ec626b36..b9a33364e553b 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1581,12 +1581,13 @@ int acpi_iommu_fwspec_init(struct device *dev, u32 id, struct fwnode_handle *fwnode, const struct iommu_ops *ops) { - int ret = iommu_fwspec_init(dev, fwnode, ops); + int ret; - if (!ret) - ret = iommu_fwspec_add_ids(dev, &id, 1); + ret = iommu_fwspec_init(dev, fwnode, ops); + if (ret) + return ret; - return ret; + return iommu_fwspec_add_ids(dev, &id, 1); } static inline const struct iommu_ops *acpi_iommu_fwspec_ops(struct device *dev)