aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lustre
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-12-20 11:41:11 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-20 11:45:09 -0800
commitb751bc77be809ca49d8f2607972f2eb361eaa642 (patch)
tree0992a6401ab3e43dee02348fbbeb919f24963208 /drivers/staging/lustre/lustre
parenta3c383c5c33627ffc01a4d493ffe52af9b463388 (diff)
staging: lustre: fix return value check in capa_hmac()
In case of error, the function crypto_alloc_hash() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre')
-rw-r--r--drivers/staging/lustre/lustre/obdclass/capa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/capa.c b/drivers/staging/lustre/lustre/obdclass/capa.c
index 86deee5e70d1..be1c613383a6 100644
--- a/drivers/staging/lustre/lustre/obdclass/capa.c
+++ b/drivers/staging/lustre/lustre/obdclass/capa.c
@@ -272,10 +272,10 @@ int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key)
alg = &capa_hmac_algs[capa_alg(capa)];
tfm = crypto_alloc_hash(alg->ha_name, 0, 0);
- if (!tfm) {
+ if (IS_ERR(tfm)) {
CERROR("crypto_alloc_tfm failed, check whether your kernel"
"has crypto support!\n");
- return -ENOMEM;
+ return PTR_ERR(tfm);
}
keylen = alg->ha_keylen;