summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorBartosz Golaszewski <brgl@bgdev.pl>2018-03-04 13:10:17 +0100
committerThomas Gleixner <tglx@linutronix.de>2018-03-09 11:44:03 +0100
commit28b6afa7d4456e759031bf83706b4be3689fba94 (patch)
tree6ce939587b964cc9b60a78252f90caac0045dba6 /kernel
parent34a866bd45d69754da1979e83a37bec6defc6295 (diff)
downloadlinux-28b6afa7d4456e759031bf83706b4be3689fba94.tar.gz
linux-28b6afa7d4456e759031bf83706b4be3689fba94.tar.bz2
linux-28b6afa7d4456e759031bf83706b4be3689fba94.zip
genirq/irq_sim: Check the return value of irq_sim_init() for error codes
As discussed with Marc Zyngier: irq_sim_init() and its devres variant should return the base of the allocated interrupt range on success rather than 0. Make devm_irq_sim_init() check for an error code. This is a preparatory change for modifying irq_sim_init() itself. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Marc Zyngier <marc.zyngier@arm.com> Link: https://lkml.kernel.org/r/20180304121018.640-3-brgl@bgdev.pl
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/irq_sim.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c
index bd7dc1db6a80..05f0d7c1698a 100644
--- a/kernel/irq/irq_sim.c
+++ b/kernel/irq/irq_sim.c
@@ -124,7 +124,7 @@ int devm_irq_sim_init(struct device *dev, struct irq_sim *sim,
return -ENOMEM;
rv = irq_sim_init(sim, num_irqs);
- if (rv) {
+ if (rv < 0) {
devres_free(dr);
return rv;
}