Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46b05c7b authored by Ingo Tuchscherer's avatar Ingo Tuchscherer Committed by Martin Schwidefsky
Browse files

s390/zcrypt: Fixed possible race condition in zcrypt module handling

parent 9fc98ad0
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -343,10 +343,11 @@ struct zcrypt_ops *__ops_lookup(unsigned char *name, int variant)
			break;
		}
	}
	if (!found || !try_module_get(zops->owner))
		zops = NULL;

	spin_unlock_bh(&zcrypt_ops_list_lock);

	if (!found)
		return NULL;
	return zops;
}

@@ -359,8 +360,6 @@ struct zcrypt_ops *zcrypt_msgtype_request(unsigned char *name, int variant)
		request_module("%s", name);
		zops = __ops_lookup(name, variant);
	}
	if ((!zops) || (!try_module_get(zops->owner)))
		return NULL;
	return zops;
}
EXPORT_SYMBOL(zcrypt_msgtype_request);