crypto: cavium - remove redundant null pointer check before kfree
authorzhong jiang <zhongjiang@huawei.com>
Fri, 21 Sep 2018 13:30:15 +0000 (21:30 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 28 Sep 2018 04:46:27 +0000 (12:46 +0800)
kfree has taken the null pointer into account. hence it is safe
to remove the redundant null pointer check before kfree.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/cavium/cpt/cptvf_reqmanager.c

index b0ba4331944b52b9093636e13b88b3e071ae182b..ca549c5dc08e7eff896e9b215b36ac7220528397 100644 (file)
@@ -308,21 +308,11 @@ void do_request_cleanup(struct cpt_vf *cptvf,
                }
        }
 
-       if (info->scatter_components)
-               kzfree(info->scatter_components);
-
-       if (info->gather_components)
-               kzfree(info->gather_components);
-
-       if (info->out_buffer)
-               kzfree(info->out_buffer);
-
-       if (info->in_buffer)
-               kzfree(info->in_buffer);
-
-       if (info->completion_addr)
-               kzfree((void *)info->completion_addr);
-
+       kzfree(info->scatter_components);
+       kzfree(info->gather_components);
+       kzfree(info->out_buffer);
+       kzfree(info->in_buffer);
+       kzfree((void *)info->completion_addr);
        kzfree(info);
 }