summaryrefslogtreecommitdiff
path: root/mm/zswap.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2020-12-15 06:14:15 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-15 23:13:46 +0300
commit42a44704367cd18d069c9855cb84090ff90ecd86 (patch)
tree95671eed4221eb141981e66d25d53539c9879752 /mm/zswap.c
parent83aed6cde84542a1d56bdc0561879cc0199ae564 (diff)
downloadlinux-42a44704367cd18d069c9855cb84090ff90ecd86.tar.xz
mm/zswap: fix passing zero to 'PTR_ERR' warning
Fix smatch warning: mm/zswap.c:425 zswap_cpu_comp_prepare() warn: passing zero to 'PTR_ERR' crypto_alloc_comp() never return NULL, use IS_ERR instead of IS_ERR_OR_NULL to fix this. Link: https://lkml.kernel.org/r/20201031055615.28080-1-yuehaibing@huawei.com Fixes: f1c54846ee45 ("zswap: dynamic pool creation") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: David Hildenbrand <david@redhat.com> Cc: Seth Jennings <sjenning@redhat.com> Cc: Dan Streetman <ddstreet@ieee.org> Cc: Vitaly Wool <vitaly.wool@konsulko.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/zswap.c')
-rw-r--r--mm/zswap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/zswap.c b/mm/zswap.c
index 1eced701b3bd..55a2f72557a8 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -421,7 +421,7 @@ static int zswap_cpu_comp_prepare(unsigned int cpu, struct hlist_node *node)
return 0;
tfm = crypto_alloc_comp(pool->tfm_name, 0, 0);
- if (IS_ERR_OR_NULL(tfm)) {
+ if (IS_ERR(tfm)) {
pr_err("could not alloc crypto comp %s : %ld\n",
pool->tfm_name, PTR_ERR(tfm));
return -ENOMEM;