Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Andy Shevchenko and committed by
Rafael J. Wysocki
602401e3 e80d4122

+5 -4
+5 -4
drivers/acpi/scan.c
··· 1581 1581 struct fwnode_handle *fwnode, 1582 1582 const struct iommu_ops *ops) 1583 1583 { 1584 - int ret = iommu_fwspec_init(dev, fwnode, ops); 1584 + int ret; 1585 1585 1586 - if (!ret) 1587 - ret = iommu_fwspec_add_ids(dev, &id, 1); 1586 + ret = iommu_fwspec_init(dev, fwnode, ops); 1587 + if (ret) 1588 + return ret; 1588 1589 1589 - return ret; 1590 + return iommu_fwspec_add_ids(dev, &id, 1); 1590 1591 } 1591 1592 1592 1593 static inline const struct iommu_ops *acpi_iommu_fwspec_ops(struct device *dev)