xt_pknock: avoid crash when hash TFM could not be allocated

This commit is contained in:
Jan Engelhardt
2011-02-24 05:33:05 +01:00
parent d4e6e3d155
commit 0ba44bd461
2 changed files with 4 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
HEAD HEAD
==== ====
Fixes:
- xt_pknock: avoid crash when hash TFM could not be allocated
v1.33 (2011-02-02) v1.33 (2011-02-02)

View File

@@ -1164,11 +1164,10 @@ static int __init xt_pknock_mt_init(void)
} }
crypto.tfm = crypto_alloc_hash(crypto.algo, 0, CRYPTO_ALG_ASYNC); crypto.tfm = crypto_alloc_hash(crypto.algo, 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(crypto.tfm)) {
if (crypto.tfm == NULL) {
printk(KERN_ERR PKNOCK "failed to load transform for %s\n", printk(KERN_ERR PKNOCK "failed to load transform for %s\n",
crypto.algo); crypto.algo);
return -ENXIO; return PTR_ERR(crypto.tfm);
} }
crypto.size = crypto_hash_digestsize(crypto.tfm); crypto.size = crypto_hash_digestsize(crypto.tfm);