Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138527
b: refs/heads/master
c: d219889
h: refs/heads/master
i:
  138525: 4d108b6
  138523: 802cbee
  138519: 5b7edd7
  138511: f1f52d1
  138495: dd4ac4b
v: v3
  • Loading branch information
Jeremy Kerr authored and Benjamin Herrenschmidt committed Mar 11, 2009
1 parent 80317d3 commit 1b28391
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 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: e7eec2fc27d7dbefd5852c36b3fe6229e6302c99
refs/heads/master: d219889b769a56901c9a916187ee0af95e6ff8a6
10 changes: 6 additions & 4 deletions trunk/arch/powerpc/platforms/cell/spufs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,10 @@ spufs_regs_write(struct file *file, const char __user *buffer,
struct spu_lscsa *lscsa = ctx->csa.lscsa;
int ret;

size = min_t(ssize_t, sizeof lscsa->gprs - *pos, size);
if (size <= 0)
if (*pos >= sizeof(lscsa->gprs))
return -EFBIG;

size = min_t(ssize_t, sizeof(lscsa->gprs) - *pos, size);
*pos += size;

ret = spu_acquire_saved(ctx);
Expand Down Expand Up @@ -623,10 +624,11 @@ spufs_fpcr_write(struct file *file, const char __user * buffer,
struct spu_lscsa *lscsa = ctx->csa.lscsa;
int ret;

size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
if (size <= 0)
if (*pos >= sizeof(lscsa->fpcr))
return -EFBIG;

size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);

ret = spu_acquire_saved(ctx);
if (ret)
return ret;
Expand Down

0 comments on commit 1b28391

Please sign in to comment.