staging: lustre: ptlrpc: service: remove unneeded null test before free
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 1 May 2015 19:37:47 +0000 (21:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 May 2015 07:23:57 +0000 (09:23 +0200)
commit207e99c20f029b8ad9784fdb3b857e0a673db949
treef278ab57a2dd0e3fbcd6b02bd7b6043281ae4af1
parent76372381dd6f5ed4b53fae0c00666e25680e21c5
staging: lustre: ptlrpc: service: 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);

@@ expression ptr; @@

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

In the first case, specific labels are introduced to free only what is needed.

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