Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17179
b: refs/heads/master
c: b41305a
h: refs/heads/master
i:
  17177: 47ae747
  17175: ace1c64
v: v3
  • Loading branch information
Arnd Bergmann authored and Paul Mackerras committed Jan 9, 2006
1 parent 1a4d0ab commit 889b906
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: d88cfffac0002c56c1a7a813cb885fa6b5fdcd0e
refs/heads/master: b41305a39a6966d8e8b1449d6b7c194923bfb451
10 changes: 6 additions & 4 deletions trunk/arch/powerpc/platforms/cell/spu_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ asmlinkage long sys_spu_create(const char __user *name,
unsigned int flags, mode_t mode)
{
long ret;
struct module *owner = spufs_calls.owner;

ret = -ENOSYS;
if (try_module_get(spufs_calls.owner)) {
if (owner && try_module_get(spufs_calls.owner)) {
ret = spufs_calls.create_thread(name, flags, mode);
module_put(spufs_calls.owner);
module_put(owner);
}
return ret;
}
Expand All @@ -51,16 +52,17 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
long ret;
struct file *filp;
int fput_needed;
struct module *owner = spufs_calls.owner;

ret = -ENOSYS;
if (try_module_get(spufs_calls.owner)) {
if (owner && try_module_get(owner)) {
ret = -EBADF;
filp = fget_light(fd, &fput_needed);
if (filp) {
ret = spufs_calls.spu_run(filp, unpc, ustatus);
fput_light(filp, fput_needed);
}
module_put(spufs_calls.owner);
module_put(owner);
}
return ret;
}
Expand Down

0 comments on commit 889b906

Please sign in to comment.