Commit 80dadf86 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'timers-urgent-for-linus' of...

Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  rtc: Staticize non-exported __rtc_set_alarm()
  rtc: Fix ioctl error path return
  ptp: Fix some locking bugs in ptp_read()
  ptp: Return -EFAULT on copy_to_user() errors
parents c78a9b9b f6509b5f
...@@ -46,7 +46,8 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) ...@@ -46,7 +46,8 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
caps.n_ext_ts = ptp->info->n_ext_ts; caps.n_ext_ts = ptp->info->n_ext_ts;
caps.n_per_out = ptp->info->n_per_out; caps.n_per_out = ptp->info->n_per_out;
caps.pps = ptp->info->pps; caps.pps = ptp->info->pps;
err = copy_to_user((void __user *)arg, &caps, sizeof(caps)); if (copy_to_user((void __user *)arg, &caps, sizeof(caps)))
err = -EFAULT;
break; break;
case PTP_EXTTS_REQUEST: case PTP_EXTTS_REQUEST:
...@@ -129,8 +130,10 @@ ssize_t ptp_read(struct posix_clock *pc, ...@@ -129,8 +130,10 @@ ssize_t ptp_read(struct posix_clock *pc,
return -ERESTARTSYS; return -ERESTARTSYS;
} }
if (ptp->defunct) if (ptp->defunct) {
mutex_unlock(&ptp->tsevq_mux);
return -ENODEV; return -ENODEV;
}
spin_lock_irqsave(&queue->lock, flags); spin_lock_irqsave(&queue->lock, flags);
...@@ -150,10 +153,8 @@ ssize_t ptp_read(struct posix_clock *pc, ...@@ -150,10 +153,8 @@ ssize_t ptp_read(struct posix_clock *pc,
mutex_unlock(&ptp->tsevq_mux); mutex_unlock(&ptp->tsevq_mux);
if (copy_to_user(buf, event, cnt)) { if (copy_to_user(buf, event, cnt))
mutex_unlock(&ptp->tsevq_mux);
return -EFAULT; return -EFAULT;
}
return cnt; return cnt;
} }
...@@ -318,7 +318,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) ...@@ -318,7 +318,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
} }
EXPORT_SYMBOL_GPL(rtc_read_alarm); EXPORT_SYMBOL_GPL(rtc_read_alarm);
int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
{ {
struct rtc_time tm; struct rtc_time tm;
long now, scheduled; long now, scheduled;
......
...@@ -421,7 +421,8 @@ static long rtc_dev_ioctl(struct file *file, ...@@ -421,7 +421,8 @@ static long rtc_dev_ioctl(struct file *file,
err = ops->ioctl(rtc->dev.parent, cmd, arg); err = ops->ioctl(rtc->dev.parent, cmd, arg);
if (err == -ENOIOCTLCMD) if (err == -ENOIOCTLCMD)
err = -ENOTTY; err = -ENOTTY;
} } else
err = -ENOTTY;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment