Skip to content

Commit 6714796

Browse files
tasksetKAGA-KOKO
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]
1 parent d00a08c commit 6714796

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
@@ -154,8 +154,9 @@ static ssize_t write_irq_affinity(int type, struct file *file,
154154
*/
155155
err = irq_select_affinity_usr(irq) ? -EINVAL : count;
156156
} else {
157-
irq_set_affinity(irq, new_value);
158-
err = count;
157+
err = irq_set_affinity(irq, new_value);
158+
if (!err)
159+
err = count;
159160
}
160161

161162
free_cpumask:

0 commit comments

Comments
 (0)