Staging: lustre: llite: dir: 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>

This patch additionally simplifies one case where the free, and thus the
jump to the end of the function, is not needed.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Julia Lawall 2015-05-01 21:38:02 +02:00 committed by Greg Kroah-Hartman
parent acd3750e57
commit 57876fd8bf

View file

@ -754,10 +754,8 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
char *buf; char *buf;
param = kzalloc(MGS_PARAM_MAXLEN, GFP_NOFS); param = kzalloc(MGS_PARAM_MAXLEN, GFP_NOFS);
if (!param) { if (!param)
rc = -ENOMEM; return -ENOMEM;
goto end;
}
buf = param; buf = param;
/* Get fsname and assume devname to be -MDT0000. */ /* Get fsname and assume devname to be -MDT0000. */
@ -786,7 +784,6 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
rc = ll_send_mgc_param(mgc->u.cli.cl_mgc_mgsexp, param); rc = ll_send_mgc_param(mgc->u.cli.cl_mgc_mgsexp, param);
end: end:
if (param != NULL)
kfree(param); kfree(param);
} }
return rc; return rc;