From: David Woodhouse Date: Tue, 23 May 2006 14:46:39 +0000 (-0700) Subject: [PATCH] powerpc: check Cell SPU syscall number range _before_ using it X-Git-Tag: v2.6.17-rc5~19 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b471f55427ee94d6de2b33b88a7409f8cbc6b5dc;p=linux-2.6 [PATCH] powerpc: check Cell SPU syscall number range _before_ using it Signed-off-by: David Woodhouse Cc: Benjamin Herrenschmidt Acked-by: Paul Mackerras Cc: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c index 67453147cd..5a0f9e3beb 100644 --- a/arch/powerpc/platforms/cell/spu_callbacks.c +++ b/arch/powerpc/platforms/cell/spu_callbacks.c @@ -339,13 +339,13 @@ long spu_sys_callback(struct spu_syscall_block *s) { long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); - syscall = spu_syscall_table[s->nr_ret]; - if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret); return -ENOSYS; } + syscall = spu_syscall_table[s->nr_ret]; + #ifdef DEBUG print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall); printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n",