Skip to content

Commit

Permalink
Merge branch 'fortglx/3.0/tip/timers/ptp' of git://git.linaro.org/peo…
Browse files Browse the repository at this point in the history
…ple/jstultz/linux into timers/urgent
  • Loading branch information
KAGA-KOKO committed Jun 6, 2011
2 parents 4bcbfff + fb5a18c commit f6509b5
Showing 1 changed file with 6 additions and 5 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;
}

0 comments on commit f6509b5

Please sign in to comment.