]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
Staging: lustre: ptlrpc: lproc_ptlrpc: remove unneeded null test before free
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 1 May 2015 19:37:49 +0000 (21:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 May 2015 07:23:56 +0000 (09:23 +0200)
commit848e90c332f500344a248e3dd673e61b8ad58ce0
tree8c4d9b4c64894e6abd4f44d65c72774227ea96ea
parent59e267c07b887015d13ec65167b75b2441d04109
Staging: lustre: ptlrpc: lproc_ptlrpc: remove unneeded null test before free

Kfree can cope with a null argument, so drop null tests.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression ptr; @@

- if (ptr != NULL)
  kfree(ptr);
// </smpl>

In the first case, the only cleanup needed is the unlock, so jump to that
directly.

Likewise, in the first two failure cases of ptlrpc_lprocfs_nrs_seq_write,
no cleanup is needed, so just drop the goto and return directly.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c