提交 b8d3de85 编写于 作者: H Himanshu Jha 提交者: Herbert Xu

crypto: n2 - remove null check before kfree

kfree on NULL pointer is a no-op and therefore checking it is redundant.
Signed-off-by: NHimanshu Jha <himanshujha199640@gmail.com>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 16d5cee5
......@@ -1962,10 +1962,8 @@ static struct n2_crypto *alloc_n2cp(void)
static void free_n2cp(struct n2_crypto *np)
{
if (np->cwq_info.ino_table) {
kfree(np->cwq_info.ino_table);
np->cwq_info.ino_table = NULL;
}
kfree(np->cwq_info.ino_table);
np->cwq_info.ino_table = NULL;
kfree(np);
}
......@@ -2079,10 +2077,8 @@ static struct n2_mau *alloc_ncp(void)
static void free_ncp(struct n2_mau *mp)
{
if (mp->mau_info.ino_table) {
kfree(mp->mau_info.ino_table);
mp->mau_info.ino_table = NULL;
}
kfree(mp->mau_info.ino_table);
mp->mau_info.ino_table = NULL;
kfree(mp);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册