Skip to content

Commit e9a902f

Browse files
Zhen Leigregkh
authored andcommitted
genirq/timings: Fix error return code in irq_timings_test_irqs()
[ Upstream commit 290fdc4 ] Return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: f52da98 ("genirq/timings: Add selftest for irqs circular buffer") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20210811093333.2376-1-thunder.leizhen@huawei.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 10d3bdd commit e9a902f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎kernel/irq/timings.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,12 +799,14 @@ static int __init irq_timings_test_irqs(struct timings_intervals *ti)
799799

800800
__irq_timings_store(irq, irqs, ti->intervals[i]);
801801
if (irqs->circ_timings[i & IRQ_TIMINGS_MASK] != index) {
802+
ret = -EBADSLT;
802803
pr_err("Failed to store in the circular buffer\n");
803804
goto out;
804805
}
805806
}
806807

807808
if (irqs->count != ti->count) {
809+
ret = -ERANGE;
808810
pr_err("Count differs\n");
809811
goto out;
810812
}

0 commit comments

Comments
 (0)