aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ptp/ptp_chardev.c11
-rw-r--r--drivers/rtc/interface.c2
-rw-r--r--drivers/rtc/rtc-dev.c3
3 files changed, 9 insertions, 7 deletions
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index a8d03aeb4051..e7f301da2902 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -46,7 +46,8 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
46 caps.n_ext_ts = ptp->info->n_ext_ts; 46 caps.n_ext_ts = ptp->info->n_ext_ts;
47 caps.n_per_out = ptp->info->n_per_out; 47 caps.n_per_out = ptp->info->n_per_out;
48 caps.pps = ptp->info->pps; 48 caps.pps = ptp->info->pps;
49 err = copy_to_user((void __user *)arg, &caps, sizeof(caps)); 49 if (copy_to_user((void __user *)arg, &caps, sizeof(caps)))
50 err = -EFAULT;
50 break; 51 break;
51 52
52 case PTP_EXTTS_REQUEST: 53 case PTP_EXTTS_REQUEST:
@@ -129,8 +130,10 @@ ssize_t ptp_read(struct posix_clock *pc,
129 return -ERESTARTSYS; 130 return -ERESTARTSYS;
130 } 131 }
131 132
132 if (ptp->defunct) 133 if (ptp->defunct) {
134 mutex_unlock(&ptp->tsevq_mux);
133 return -ENODEV; 135 return -ENODEV;
136 }
134 137
135 spin_lock_irqsave(&queue->lock, flags); 138 spin_lock_irqsave(&queue->lock, flags);
136 139
@@ -150,10 +153,8 @@ ssize_t ptp_read(struct posix_clock *pc,
150 153
151 mutex_unlock(&ptp->tsevq_mux); 154 mutex_unlock(&ptp->tsevq_mux);
152 155
153 if (copy_to_user(buf, event, cnt)) { 156 if (copy_to_user(buf, event, cnt))
154 mutex_unlock(&ptp->tsevq_mux);
155 return -EFAULT; 157 return -EFAULT;
156 }
157 158
158 return cnt; 159 return cnt;
159} 160}
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index ef6316acec43..df68618f6dbb 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -318,7 +318,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
318} 318}
319EXPORT_SYMBOL_GPL(rtc_read_alarm); 319EXPORT_SYMBOL_GPL(rtc_read_alarm);
320 320
321int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) 321static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
322{ 322{
323 struct rtc_time tm; 323 struct rtc_time tm;
324 long now, scheduled; 324 long now, scheduled;
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index d0e06edb14c5..cace6d3aed9a 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -421,7 +421,8 @@ static long rtc_dev_ioctl(struct file *file,
421 err = ops->ioctl(rtc->dev.parent, cmd, arg); 421 err = ops->ioctl(rtc->dev.parent, cmd, arg);
422 if (err == -ENOIOCTLCMD) 422 if (err == -ENOIOCTLCMD)
423 err = -ENOTTY; 423 err = -ENOTTY;
424 } 424 } else
425 err = -ENOTTY;
425 break; 426 break;
426 } 427 }
427 428