summaryrefslogtreecommitdiffstats
path: root/kernel/irq
diff options
context:
space:
mode:
authorWen Yaxng <wen.yang99@zte.com.cn>2017-11-08 02:55:03 +0100
committerThomas Gleixner <tglx@linutronix.de>2017-11-12 23:25:39 +0100
commit6714796edcce27f7a1845e2f79783cd51bb4799b (patch)
tree9013b662811f2604112e1aa7f9621b6962e98ac4 /kernel/irq
parentirq/work: Use llist_for_each_entry_safe (diff)
downloadlinux-6714796edcce27f7a1845e2f79783cd51bb4799b.tar.xz
linux-6714796edcce27f7a1845e2f79783cd51bb4799b.zip
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 <wen.yang99@zte.com.cn> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jiang Biao <jiang.biao2@zte.com.cn> Cc: zhong.weidong@zte.com.cn Link: https://lkml.kernel.org/r/1510106103-184761-1-git-send-email-wen.yang99@zte.com.cn
Diffstat (limited to 'kernel/irq')
-rw-r--r--kernel/irq/proc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 6376b4a598d3..29d6f520a9fb 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -154,8 +154,9 @@ static ssize_t write_irq_affinity(int type, struct file *file,
*/
err = irq_select_affinity_usr(irq) ? -EINVAL : count;
} else {
- irq_set_affinity(irq, new_value);
- err = count;
+ err = irq_set_affinity(irq, new_value);
+ if (!err)
+ err = count;
}
free_cpumask: