Commit fb5a18cf authored by Dan Carpenter's avatar Dan Carpenter Committed by John Stultz
Browse files

ptp: Fix some locking bugs in ptp_read()

In ptp_read there is an unlock missing on an error path, and a double
unlock on another error path.

Signed-off-by: default avatarDan Carpenter <>
Acked-by: default avatarRichard Cochran <>
Signed-off-by: default avatarJohn Stultz <>
parent e23ef227
......@@ -130,8 +130,10 @@ ssize_t ptp_read(struct posix_clock *pc,
if (ptp->defunct)
if (ptp->defunct) {
return -ENODEV;
spin_lock_irqsave(&queue->lock, flags);
......@@ -151,10 +153,8 @@ ssize_t ptp_read(struct posix_clock *pc,
if (copy_to_user(buf, event, cnt)) {
if (copy_to_user(buf, event, cnt))
return -EFAULT;
return cnt;
Supports Markdown
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