aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ptp/ptp_chardev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ptp/ptp_chardev.c')
-rw-r--r--drivers/ptp/ptp_chardev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index 93fa22de5977..e7f301da2902 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -130,8 +130,10 @@ ssize_t ptp_read(struct posix_clock *pc,
130 return -ERESTARTSYS; 130 return -ERESTARTSYS;
131 } 131 }
132 132
133 if (ptp->defunct) 133 if (ptp->defunct) {
134 mutex_unlock(&ptp->tsevq_mux);
134 return -ENODEV; 135 return -ENODEV;
136 }
135 137
136 spin_lock_irqsave(&queue->lock, flags); 138 spin_lock_irqsave(&queue->lock, flags);
137 139
@@ -151,10 +153,8 @@ ssize_t ptp_read(struct posix_clock *pc,
151 153
152 mutex_unlock(&ptp->tsevq_mux); 154 mutex_unlock(&ptp->tsevq_mux);
153 155
154 if (copy_to_user(buf, event, cnt)) { 156 if (copy_to_user(buf, event, cnt))
155 mutex_unlock(&ptp->tsevq_mux);
156 return -EFAULT; 157 return -EFAULT;
157 }
158 158
159 return cnt; 159 return cnt;
160} 160}