summary refs log tree commit diff
path: root/drivers/char/hw_random/octeon-rng.c
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2013-12-29 23:47:36 +0100
committerMatthew Garrett <matthew.garrett@nebula.com>2014-01-21 08:44:17 -0500
commitb30bb89f0fb29502f573d01419391a1e2a4cc4f1 (patch)
tree7698fd123c24738df516325564cadca74997e559 /drivers/char/hw_random/octeon-rng.c
parent97f440c23f2b02fac8af0558cba9ca0bed603794 (diff)
downloadlinux-b30bb89f0fb29502f573d01419391a1e2a4cc4f1.tar.gz
fujitsu-laptop: fix error return code
These functions mix the use of result and error.  In acpi_fujitsu_add,
result does not seem useful; it would seem reasonable to propagate the
return value of acpi_bus_update_power in an error case.  On the other hand,
in the case of acpi_fujitsu_hotkey_add, there is an initialization of
result that can lead to what looks like a failure case, but that does not
abort the function.  The variable result is kept for this case.

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

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/char/hw_random/octeon-rng.c')
0 files changed, 0 insertions, 0 deletions