diff options
Diffstat (limited to 'drivers/s390/crypto/ap_queue.c')
-rw-r--r-- | drivers/s390/crypto/ap_queue.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/s390/crypto/ap_queue.c b/drivers/s390/crypto/ap_queue.c index 480c58a63769..0f1a5d02acb0 100644 --- a/drivers/s390/crypto/ap_queue.c +++ b/drivers/s390/crypto/ap_queue.c | |||
@@ -584,7 +584,14 @@ static struct device_type ap_queue_type = { | |||
584 | 584 | ||
585 | static void ap_queue_device_release(struct device *dev) | 585 | static void ap_queue_device_release(struct device *dev) |
586 | { | 586 | { |
587 | kfree(to_ap_queue(dev)); | 587 | struct ap_queue *aq = to_ap_queue(dev); |
588 | |||
589 | if (!list_empty(&aq->list)) { | ||
590 | spin_lock_bh(&ap_list_lock); | ||
591 | list_del_init(&aq->list); | ||
592 | spin_unlock_bh(&ap_list_lock); | ||
593 | } | ||
594 | kfree(aq); | ||
588 | } | 595 | } |
589 | 596 | ||
590 | struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type) | 597 | struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type) |