Commit [f65a03]  Maximize  Restore  History

kexec: return -EFAULT on copy_to_user() failures

copy_to/from_user() returns the number of bytes remaining to be copied.
It never returns a negative value. The correct return code is -EFAULT and
not -EIO.

All the callers check for non-zero returns so that's Ok, but the return
code is passed to the user so we should fix this.

Signed-off-by: Dan Carpenter <>
Cc: Hidetoshi Seto <>
Cc: "Paul E. McKenney" <>
Cc: "Eric W. Biederman" <>
Cc: Simon Kagstrom <>
Acked-by: WANG Cong <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>

Dan Carpenter Dan Carpenter 2010-08-11

Linus Torvalds Linus Torvalds 2010-08-11

changed kernel/kexec.c
kernel/kexec.c Diff Switch to side-by-side view

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks