瀏覽代碼

[PATCH] spufs fix spu_acquire_runnable error path

When spu_activate fails in spu_acquire_runnable, the
state must still be SPU_STATE_SAVED, we were
incorrectly setting it to SPU_STATE_RUNNABLE.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Arnd Bergmann 19 年之前
父節點
當前提交
0106246594
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      arch/powerpc/platforms/cell/spufs/context.c

+ 2 - 2
arch/powerpc/platforms/cell/spufs/context.c

@@ -132,10 +132,10 @@ int spu_acquire_runnable(struct spu_context *ctx)
 
 	if (ctx->state == SPU_STATE_SAVED) {
 		ret = spu_activate(ctx, 0);
+		if (ret)
+			goto out;
 		ctx->state = SPU_STATE_RUNNABLE;
 	}
-	if (ret)
-		goto out;
 
 	downgrade_write(&ctx->state_sema);
 	/* On success, we return holding the lock */