Skip to contentSkip to conversation

genirq/procfs: Change the return value for set affinity permission error

PATCH Applied Jeff Xie 2 participants 2 messages Aug 26, 2024 – Aug 29, 2024 IRQ

lore
Share & tools
lore

Jeff Xie

author
#0 lore raw

PATCH 1/1 genirq/procfs: Change the return value for set affinity permission error

Currently, when the affinity of an irq cannot be set due to lack of permission, the write_irq_affinity() returns the error code -EIO

Obviously, due to a permissions error, it should return -EPERM

---
 kernel/irq/proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/proc.c +1 -1
index dcf8190a58ca..7b3a4c92d148 100644
@@ -142,7 +142,7 @@ static ssize_t write_irq_affinity(int type, struct file *file,
 	int err;
 
 	if (!irq_can_set_affinity_usr(irq) || no_irq_affinity)
-		return -EIO;
+		return -EPERM;
 
 	if (!zalloc_cpumask_var(&new_value, GFP_KERNEL))
 		return -ENOMEM;
Signature · 1 line
2.43.0
merge bot Applied
#1 lore raw

[tip: irq/core] genirq/proc: Change the return value for set affinity permission error

The following commit has been merged into the irq/core branch of tip:

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     eb29369fa543e7d5557c19ebecf072244bb14815
Gitweb:        https://git.kernel.org/tip/eb29369fa543e7d5557c19ebecf072244bb14815
Author:        Jeff Xie <[email protected]>
AuthorDate:    Mon, 26 Aug 2024 22:58:05 +08:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Thu, 29 Aug 2024 16:42:06 +02:00

genirq/proc: Change the return value for set affinity permission error

Currently, when the affinity of an irq cannot be set due to lack of permission, the write_irq_affinity() returns the error code -EIO.

Change the return value to -EPERM as that reflects the cause of error correctly.

---
 kernel/irq/proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/proc.c +1 -1
index d98fb9c..9081ada 100644
@@ -140,7 +140,7 @@ static ssize_t write_irq_affinity(int type, struct file *file,
 	int err;
 
 	if (!irq_can_set_affinity_usr(irq) || no_irq_affinity)
-		return -EIO;
+		return -EPERM;
 
 	if (!zalloc_cpumask_var(&new_value, GFP_KERNEL))
 		return -ENOMEM;