Skip to content

Commit

Permalink
genirq/irq_sim: Check the return value of irq_sim_init() for error codes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Bartosz Golaszewski authored and Thomas Gleixner committed Mar 9, 2018
1 parent 34a866b commit 28b6afa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/irq/irq_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 28b6afa

Please sign in to comment.