Skip to content

Commit 94c1eb8

Browse files
tasksetSomasundaram Krishnasamy
authored andcommitted
genirq/proc: Return proper error code when irq_set_affinity() fails
write_irq_affinity() returns the number of written bytes, which means success, unconditionally whether the actual irq_set_affinity() call succeeded or not. Add proper error handling and pass the error code returned from irq_set_affinity() back to user space in case of failure. [ tglx: Fixed coding style and massaged changelog ] Signed-off-by: Wen Yang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Jiang Biao <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Orabug: 31723449 (cherry picked from commit 6714796) Signed-off-by: Jacob Wen <[email protected]> Reviewed-by: John Donnelly <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent f1e0e0e commit 94c1eb8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kernel/irq/proc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ static ssize_t write_irq_affinity(int type, struct file *file,
155155
*/
156156
err = irq_select_affinity_usr(irq) ? -EINVAL : count;
157157
} else {
158-
irq_set_affinity(irq, new_value);
159-
err = count;
158+
err = irq_set_affinity(irq, new_value);
159+
if (!err)
160+
err = count;
160161
}
161162

162163
free_cpumask:

0 commit comments

Comments
 (0)