Skip to content

Commit

Permalink
MIPS: remove broken conditional inside vpe loader code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Crispin committed Feb 19, 2013
1 parent df1cc3d commit 535237c
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions arch/mips/kernel/vpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,18 +697,7 @@ static int vpe_run(struct vpe * v)
dmt_flag = dmt();
vpeflags = dvpe();

if (!list_empty(&v->tc)) {
if ((t = list_entry(v->tc.next, struct tc, tc)) == NULL) {
evpe(vpeflags);
emt(dmt_flag);
local_irq_restore(flags);

printk(KERN_WARNING
"VPE loader: TC %d is already in use.\n",
v->tc->index);
return -ENOEXEC;
}
} else {
if (list_empty(&v->tc)) {
evpe(vpeflags);
emt(dmt_flag);
local_irq_restore(flags);
Expand All @@ -720,6 +709,8 @@ static int vpe_run(struct vpe * v)
return -ENOEXEC;
}

t = list_first_entry(&v->tc, struct tc, tc);

/* Put MVPE's into 'configuration state' */
set_c0_mvpcontrol(MVPCONTROL_VPC);

Expand Down

0 comments on commit 535237c

Please sign in to comment.