diff options
-rw-r--r-- | drivers/s390/crypto/zcrypt_api.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 0e18c5dcd91f..08f1830cbfc4 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c | |||
@@ -343,10 +343,11 @@ struct zcrypt_ops *__ops_lookup(unsigned char *name, int variant) | |||
343 | break; | 343 | break; |
344 | } | 344 | } |
345 | } | 345 | } |
346 | if (!found || !try_module_get(zops->owner)) | ||
347 | zops = NULL; | ||
348 | |||
346 | spin_unlock_bh(&zcrypt_ops_list_lock); | 349 | spin_unlock_bh(&zcrypt_ops_list_lock); |
347 | 350 | ||
348 | if (!found) | ||
349 | return NULL; | ||
350 | return zops; | 351 | return zops; |
351 | } | 352 | } |
352 | 353 | ||
@@ -359,8 +360,6 @@ struct zcrypt_ops *zcrypt_msgtype_request(unsigned char *name, int variant) | |||
359 | request_module("%s", name); | 360 | request_module("%s", name); |
360 | zops = __ops_lookup(name, variant); | 361 | zops = __ops_lookup(name, variant); |
361 | } | 362 | } |
362 | if ((!zops) || (!try_module_get(zops->owner))) | ||
363 | return NULL; | ||
364 | return zops; | 363 | return zops; |
365 | } | 364 | } |
366 | EXPORT_SYMBOL(zcrypt_msgtype_request); | 365 | EXPORT_SYMBOL(zcrypt_msgtype_request); |