Skip to content

Commit 535237c

Browse files
author
John Crispin
committed
MIPS: remove broken conditional inside vpe loader code
The commit [1] breaks builds and results in the following error arch/mips/kernel/vpe.c: In function 'vpe_run': arch/mips/kernel/vpe.c:708:16: error: invalid type argument of '->' (have 'struct list_head') Taking a closer look at the conditional we notice that list_first_entry wont ever return NULL. The easiest fix is to just drop the dead code. [1] commit 3d2d032 MIPS: vpe.c: Fix null pointer dereference in print arguments. Signed-off-by: John Crispin <blogic@openwrt.org>
1 parent df1cc3d commit 535237c

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

‎arch/mips/kernel/vpe.c‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -697,18 +697,7 @@ static int vpe_run(struct vpe * v)
697697
dmt_flag = dmt();
698698
vpeflags = dvpe();
699699

700-
if (!list_empty(&v->tc)) {
701-
if ((t = list_entry(v->tc.next, struct tc, tc)) == NULL) {
702-
evpe(vpeflags);
703-
emt(dmt_flag);
704-
local_irq_restore(flags);
705-
706-
printk(KERN_WARNING
707-
"VPE loader: TC %d is already in use.\n",
708-
v->tc->index);
709-
return -ENOEXEC;
710-
}
711-
} else {
700+
if (list_empty(&v->tc)) {
712701
evpe(vpeflags);
713702
emt(dmt_flag);
714703
local_irq_restore(flags);
@@ -720,6 +709,8 @@ static int vpe_run(struct vpe * v)
720709
return -ENOEXEC;
721710
}
722711

712+
t = list_first_entry(&v->tc, struct tc, tc);
713+
723714
/* Put MVPE's into 'configuration state' */
724715
set_c0_mvpcontrol(MVPCONTROL_VPC);
725716

0 commit comments

Comments
 (0)