From: André Almeida Date: Fri, 12 Jul 2019 03:53:43 +0000 (-0700) Subject: mm/kmemleak.c: change error at _write when kmemleak is disabled X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4e4dfce2278929de4379cdcfa2335dad7a6c4aa0;p=linux.git mm/kmemleak.c: change error at _write when kmemleak is disabled According to POSIX, EBUSY means that the "device or resource is busy", and this can lead to people thinking that the file `/sys/kernel/debug/kmemleak/` is somehow locked or being used by other process. Change this error code to a more appropriate one. Link: http://lkml.kernel.org/r/20190612155231.19448-1-andrealmeid@collabora.com Signed-off-by: André Almeida Reviewed-by: Andrew Morton Acked-by: Catalin Marinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 3e147ea831826..aa8f4fa93ca39 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1866,7 +1866,7 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf, } if (!kmemleak_enabled) { - ret = -EBUSY; + ret = -EPERM; goto out; }