Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98707
b: refs/heads/master
c: 4b1295b
h: refs/heads/master
i:
  98705: 229d087
  98703: e4344dc
v: v3
  • Loading branch information
Sebastian Siewior authored and Linus Torvalds committed Jul 4, 2008
1 parent 0345039 commit 5fd84c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bef67c5a7d3a9c45e091e36625c09c0c811e2672
refs/heads/master: 4b1295b0df28cffd40e6c6d7c4b88dec7af1eb76
10 changes: 4 additions & 6 deletions trunk/drivers/spi/spidev.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ spidev_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)

mutex_lock(&spidev->buf_lock);
status = spidev_sync_read(spidev, count);
if (status == 0) {
if (status > 0) {
unsigned long missing;

missing = copy_to_user(buf, spidev->buffer, count);
if (count && missing == count)
missing = copy_to_user(buf, spidev->buffer, status);
if (missing == status)
status = -EFAULT;
else
status = count - missing;
status = status - missing;
}
mutex_unlock(&spidev->buf_lock);

Expand All @@ -200,8 +200,6 @@ spidev_write(struct file *filp, const char __user *buf,
missing = copy_from_user(spidev->buffer, buf, count);
if (missing == 0) {
status = spidev_sync_write(spidev, count);
if (status == 0)
status = count;
} else
status = -EFAULT;
mutex_unlock(&spidev->buf_lock);
Expand Down

0 comments on commit 5fd84c3

Please sign in to comment.