Skip to content

Commit 67a15bb

Browse files
author
Fox Snowpatch
committed
1 parent a2f7734 commit 67a15bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/powerpc/kernel/rtas-proc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ static int ppc_rtas_find_all_sensors(void)
437437
}
438438

439439
sensors.quant = len / 8; /* int + int */
440+
if (sensors.quant > ARRAY_SIZE(sensors.sensor)) {
441+
pr_err("too many sensors reported: %u\n", sensors.quant);
442+
return 1;
443+
}
440444

441445
for (i=0; i<sensors.quant; i++) {
442446
sensors.sensor[i].token = *utmp++;

0 commit comments

Comments
 (0)