Unverified Commit b5ea0395 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7229 s390/zcrypt: fix reference counting on zcrypt card objects

parents d42bf189 9d07bdd8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -576,6 +576,7 @@ static inline struct zcrypt_queue *zcrypt_pick_queue(struct zcrypt_card *zc,
{
	if (!zq || !try_module_get(zq->queue->ap_dev.drv->driver.owner))
		return NULL;
	zcrypt_card_get(zc);
	zcrypt_queue_get(zq);
	get_device(&zq->queue->ap_dev.device);
	atomic_add(weight, &zc->load);
@@ -595,6 +596,7 @@ static inline void zcrypt_drop_queue(struct zcrypt_card *zc,
	atomic_sub(weight, &zq->load);
	put_device(&zq->queue->ap_dev.device);
	zcrypt_queue_put(zq);
	zcrypt_card_put(zc);
	module_put(mod);
}