[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: Dave Scidmore <dscidmore@xes-inc.com>
Signed-off-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by Nate Case and committed by Paul Mackerras 9c8387af 64e4566f

+2 -2
+2 -2
include/asm-powerpc/uaccess.h
··· 380 380 const void __user *from, unsigned long n) 381 381 { 382 382 if (__builtin_constant_p(n) && (n <= 8)) { 383 - unsigned long ret; 383 + unsigned long ret = 1; 384 384 385 385 switch (n) { 386 386 case 1: ··· 406 406 const void *from, unsigned long n) 407 407 { 408 408 if (__builtin_constant_p(n) && (n <= 8)) { 409 - unsigned long ret; 409 + unsigned long ret = 1; 410 410 411 411 switch (n) { 412 412 case 1: