posix-timers: sys_timer_create: cleanup the error handling
authorOleg Nesterov <oleg@tv-sign.ru>
Mon, 22 Sep 2008 21:42:49 +0000 (14:42 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 24 Sep 2008 13:45:48 +0000 (15:45 +0200)
commitef864c958801768fb28bd3603cd0b098b394671c
treeea0291b5f3281b1e7d4432dd8c31e1182446cd89
parent717835d94d3e3d343a302df0a3cb9405887c3e2a
posix-timers: sys_timer_create: cleanup the error handling

Cleanup.

- sys_timer_create() is big and complicated. The code above the "out:"
  label relies on the fact that "error" must be == 0. This is not very
  robust, make the code more explicit. Remove the unneeded initialization
  of error.

- If idr_get_new() succeeds (as it normally should), we check the returned
  value twice. Move the "-EAGAIN" check under "if (error)".

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: mingo@elte.hu
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/posix-timers.c