Skip to content
Commit 9c8387af authored by Nate Case's avatar Nate Case Committed by Paul Mackerras
Browse files

[POWERPC] Fix uninitialized variable bug in copy_{to|from}_user



Calls to copy_to_user() or copy_from_user() can fail when copying N
bytes, where N is a constant less than 8, but not 1, 2, 4, or 8,
because 'ret' is not initialized and is only set if the size is 1,
2, 4 or 8, but is tested after the switch statement for any constant
size <= 8.  This fixes it by initializing 'ret' to 1, causing the
code to fall through to the __copy_tofrom_user call for sizes other
than 1, 2, 4 or 8.

Signed-off-by: default avatarDave Scidmore <dscidmore@xes-inc.com>
Signed-off-by: default avatarNate Case <ncase@xes-inc.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 64e4566f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment