summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/virt/tegra/ivc-cdev.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/virt/tegra/ivc-cdev.c b/drivers/virt/tegra/ivc-cdev.c
index a4dab9b3f..b448075c5 100644
--- a/drivers/virt/tegra/ivc-cdev.c
+++ b/drivers/virt/tegra/ivc-cdev.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * IVC character device driver 2 * IVC character device driver
3 * 3 *
4 * Copyright (C) 2014-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (C) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This file is licensed under the terms of the GNU General Public License 6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any 7 * version 2. This program is licensed "as is" without any warranty of any
@@ -98,12 +98,12 @@ static int ivc_dev_open(struct inode *inode, struct file *filp)
98 mutex_unlock(&ivc->file_lock); 98 mutex_unlock(&ivc->file_lock);
99 99
100 /* request our irq */ 100 /* request our irq */
101 ret = devm_request_threaded_irq(ivc->device, ivc->qd->irq, 101 ret = devm_request_threaded_irq(ivc->device, ivck->irq,
102 ivc_threaded_irq_handler, ivc_dev_handler, 0, 102 ivc_threaded_irq_handler, ivc_dev_handler, 0,
103 dev_name(ivc->device), ivc); 103 dev_name(ivc->device), ivc);
104 if (ret < 0) { 104 if (ret < 0) {
105 dev_err(ivc->device, "Failed to request irq %d\n", 105 dev_err(ivc->device, "Failed to request irq %d\n",
106 ivc->qd->irq); 106 ivck->irq);
107 ivc->ivck = NULL; 107 ivc->ivck = NULL;
108 tegra_hv_ivc_unreserve(ivck); 108 tegra_hv_ivc_unreserve(ivck);
109 return ret; 109 return ret;
@@ -124,10 +124,11 @@ static int ivc_dev_release(struct inode *inode, struct file *filp)
124 124
125 BUG_ON(!ivc); 125 BUG_ON(!ivc);
126 126
127 free_irq(ivc->qd->irq, ivc);
128
129 ivck = ivc->ivck; 127 ivck = ivc->ivck;
130 ivc->ivck = NULL; 128 ivc->ivck = NULL;
129
130 free_irq(ivck->irq, ivc);
131
131 /* 132 /*
132 * Unreserve after clearing ivck; we no longer have exclusive 133 * Unreserve after clearing ivck; we no longer have exclusive
133 * access at this point. 134 * access at this point.