]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Return proper error code in irq_remapping_alloc()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 22 Mar 2018 15:22:42 +0000 (16:22 +0100)
committerJoerg Roedel <jroedel@suse.de>
Thu, 29 Mar 2018 08:38:17 +0000 (10:38 +0200)
commit16a1f77b2718933f980752561b2ebf7adc58a141
treef793b2c78101d960183bca9fdb8e6f4a2b373a5b
parent31be187da36d83fdde9f33a9128bb60d0bfeb280
iommu/amd: Return proper error code in irq_remapping_alloc()

In the unlikely case when alloc_irq_table() is not able to return a
remap table then "ret" will be assigned with an error code. Later, the
code checks `index' and if it is negative (which it is because it is
initialized with `-1') and then then function properly aborts but
returns `-1' instead `-ENOMEM' what was intended.
In order to correct this, I assign -ENOMEM to index.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c