Skip to content

Commit

Permalink
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/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
  • Loading branch information
Linus Torvalds committed Jun 13, 2011
2 parents c78a9b9 + f6509b5 commit 80dadf8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions drivers/ptp/ptp_chardev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_per_out = ptp->info->n_per_out;
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;

case PTP_EXTTS_REQUEST:
Expand Down Expand Up @@ -129,8 +130,10 @@ ssize_t ptp_read(struct posix_clock *pc,
return -ERESTARTSYS;
}

if (ptp->defunct)
if (ptp->defunct) {
mutex_unlock(&ptp->tsevq_mux);
return -ENODEV;
}

spin_lock_irqsave(&queue->lock, flags);

Expand All @@ -150,10 +153,8 @@ ssize_t ptp_read(struct posix_clock *pc,

mutex_unlock(&ptp->tsevq_mux);

if (copy_to_user(buf, event, cnt)) {
mutex_unlock(&ptp->tsevq_mux);
if (copy_to_user(buf, event, cnt))
return -EFAULT;
}

return cnt;
}
2 changes: 1 addition & 1 deletion drivers/rtc/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *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;
long now, scheduled;
Expand Down
3 changes: 2 additions & 1 deletion drivers/rtc/rtc-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ static long rtc_dev_ioctl(struct file *file,
err = ops->ioctl(rtc->dev.parent, cmd, arg);
if (err == -ENOIOCTLCMD)
err = -ENOTTY;
}
} else
err = -ENOTTY;
break;
}

Expand Down

0 comments on commit 80dadf8

Please sign in to comment.