linux-stable/arch
Julia Lawall 41fb433b63 arch/x86/kernel/kdebugfs.c: Ensure a consistent return value in error case
Typically, the return value desired for the failure of a
function with an integer return value is a negative integer.  In
these cases, the return value is sometimes a negative integer
and sometimes 0, due to a subsequent initialization of the
return variable within the loop.

A simplified version of the semantic match that finds this
problem is: (http://coccinelle.lip6.fr/)

//<smpl>
@r exists@
identifier ret;
position p;
constant C;
expression e1,e3,e4;
statement S;
@@

ret = -C
... when != ret = e3
    when any
if@p (...) S
... when any
if (\(ret != 0\|ret < 0\|ret > 0\) || ...) { ... return ...; }
... when != ret = e3
    when any
*if@p (...)
{
  ... when != ret = e4
  return ret;
}
//</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Link: http://lkml.kernel.org/r/1342284188-19176-7-git-send-email-Julia.Lawall@lip6.fr
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-07-26 15:07:20 +02:00
..
alpha Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-06-01 11:53:44 -07:00
arm ARM: SoC fixes for SPEAr 2012-07-18 10:27:08 -07:00
avr32 fixups for signal breakage 2012-06-04 17:47:34 -04:00
blackfin Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-06-05 09:47:15 -07:00
c6x new helper: signal_delivered() 2012-06-01 12:58:52 -04:00
cris Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-06-01 11:53:44 -07:00
frv frv: Remove bogus closing parenthesis 2012-06-02 10:38:19 -04:00
h8300 h8300/uaccess: add mising __clear_user() 2012-07-11 16:04:46 -07:00
hexagon hexagon: SMP: Remove call to ipi_call_lock()/ipi_call_unlock() 2012-06-05 17:27:11 +02:00
ia64 ia64: SMP: Remove call to ipi_call_lock_irq()/ipi_call_unlock_irq() 2012-06-05 17:27:13 +02:00
m32r Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-07-22 11:22:15 -07:00
m68k m68knommu: define a local devm_clk_get() function 2012-06-25 09:17:20 +10:00
microblaze new helper: signal_delivered() 2012-06-01 12:58:52 -04:00
mips Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-07-20 12:02:02 -07:00
mn10300 Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-07-22 11:22:15 -07:00
openrisc new helper: signal_delivered() 2012-06-01 12:58:52 -04:00
parisc Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-07-22 11:22:15 -07:00
powerpc Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-07-22 11:22:15 -07:00
s390 S390: Smp: remove call to ipi_call_lock()/ipi_call_unlock() 2012-06-05 17:27:12 +02:00
score new helper: signal_delivered() 2012-06-01 12:58:52 -04:00
sh SH: Convert out[bwl] macros to inline functions 2012-07-12 13:12:13 +09:00
sparc Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-07-22 11:22:15 -07:00
tile Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-07-22 11:22:15 -07:00
um Revert "rcu: Move PREEMPT_RCU preemption to switch_to() invocation" 2012-07-02 11:39:19 -07:00
unicore32 new helper: signal_delivered() 2012-06-01 12:58:52 -04:00
x86 arch/x86/kernel/kdebugfs.c: Ensure a consistent return value in error case 2012-07-26 15:07:20 +02:00
xtensa xtensa: fix incorrect memset 2012-07-11 16:04:49 -07:00
.gitignore
Kconfig Merge branch 'for-linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping 2012-05-25 09:18:59 -07:00