[RFC PATCH 10/13] powerpc/spufs: future proof usage of list iterator after the loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With the speculative safe version of the list iterator spu will be NULL
if the terminating condition was hit and needs to be reset to spu
derived from the head, before returning spu.

Signed-off-by: Jakob Koschel <jakobkoschel@xxxxxxxxx>
---
 arch/powerpc/platforms/cell/spufs/sched.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 369206489895..5b2afda1653d 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -384,6 +384,8 @@ static struct spu *ctx_location(struct spu *ref, int offset, int node)
 		}
 	}
 
+	if (!spu)
+		spu = list_entry(spu, ref->aff_list.prev, aff_list);
 	return spu;
 }
 
-- 
2.25.1




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux