瀏覽代碼

staging: lustre: mdc: 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>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Julia Lawall 10 年之前
父節點
當前提交
6fa7cbab38
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      drivers/staging/lustre/lustre/mdc/mdc_request.c

+ 1 - 2
drivers/staging/lustre/lustre/mdc/mdc_request.c

@@ -1644,8 +1644,7 @@ out:
 		llog_cat_close(NULL, llh);
 		llog_cat_close(NULL, llh);
 	if (ctxt)
 	if (ctxt)
 		llog_ctxt_put(ctxt);
 		llog_ctxt_put(ctxt);
-	if (cs->cs_buf)
-		kfree(cs->cs_buf);
+	kfree(cs->cs_buf);
 	kfree(cs);
 	kfree(cs);
 	return rc;
 	return rc;
 }
 }