Skip to content

Commit

Permalink
fs/compat_ioctl.c: suppress two warnings
Browse files Browse the repository at this point in the history
fs/compat_ioctl.c: In function 'do_ioctl_trans':
fs/compat_ioctl.c:534: warning: 'karg' may be used uninitialized in this function
fs/compat_ioctl.c:533: warning: 'kcmd' may be used uninitialized in this function
fs/compat_ioctl.c:656: warning: 'ret' may be used uninitialized in this function

Reduces text size by 44 bytes.

If someone calls one of these functions with an unexpected argument, the
code's buggy as-is.

Amerigo Wang <amwang@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Mar 6, 2010
1 parent 08564fb commit 45bf5cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ static int mt_ioctl_trans(unsigned int fd, unsigned int cmd, void __user *argp)
kcmd = MTIOCPOS;
karg = &pos;
break;
case MTIOCGET32:
default: /* MTIOCGET32 */
kcmd = MTIOCGET;
karg = &get;
break;
Expand Down Expand Up @@ -663,7 +663,7 @@ static int raw_ioctl(unsigned fd, unsigned cmd,

switch (cmd) {
case RAW_SETBIND:
case RAW_GETBIND: {
default: { /* RAW_GETBIND */
struct raw_config_request req;
mm_segment_t oldfs = get_fs();

Expand Down

0 comments on commit 45bf5cd

Please sign in to comment.