Skip to content

Commit

Permalink
mm/kmemleak.c: change error at _write when kmemleak is disabled
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: André Almeida <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Acked-by: Catalin Marinas <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
andrealmeid authored and torvalds committed Jul 12, 2019
1 parent 6ef9056 commit 4e4dfce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/kmemleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4e4dfce

Please sign in to comment.