@@ -190,6 +190,14 @@ static struct its_collection *valid_col(struct its_collection *col)
190
190
return col ;
191
191
}
192
192
193
+ static struct its_vpe * valid_vpe (struct its_node * its , struct its_vpe * vpe )
194
+ {
195
+ if (valid_col (its -> collections + vpe -> col_idx ))
196
+ return vpe ;
197
+
198
+ return NULL ;
199
+ }
200
+
193
201
/*
194
202
* ITS command descriptors - parameters to be encoded in a command
195
203
* block.
@@ -562,7 +570,7 @@ static struct its_vpe *its_build_vinvall_cmd(struct its_node *its,
562
570
563
571
its_fixup_cmd (cmd );
564
572
565
- return desc -> its_vinvall_cmd .vpe ;
573
+ return valid_vpe ( its , desc -> its_vinvall_cmd .vpe ) ;
566
574
}
567
575
568
576
static struct its_vpe * its_build_vmapp_cmd (struct its_node * its ,
@@ -584,7 +592,7 @@ static struct its_vpe *its_build_vmapp_cmd(struct its_node *its,
584
592
585
593
its_fixup_cmd (cmd );
586
594
587
- return desc -> its_vmapp_cmd .vpe ;
595
+ return valid_vpe ( its , desc -> its_vmapp_cmd .vpe ) ;
588
596
}
589
597
590
598
static struct its_vpe * its_build_vmapti_cmd (struct its_node * its ,
@@ -607,7 +615,7 @@ static struct its_vpe *its_build_vmapti_cmd(struct its_node *its,
607
615
608
616
its_fixup_cmd (cmd );
609
617
610
- return desc -> its_vmapti_cmd .vpe ;
618
+ return valid_vpe ( its , desc -> its_vmapti_cmd .vpe ) ;
611
619
}
612
620
613
621
static struct its_vpe * its_build_vmovi_cmd (struct its_node * its ,
@@ -630,7 +638,7 @@ static struct its_vpe *its_build_vmovi_cmd(struct its_node *its,
630
638
631
639
its_fixup_cmd (cmd );
632
640
633
- return desc -> its_vmovi_cmd .vpe ;
641
+ return valid_vpe ( its , desc -> its_vmovi_cmd .vpe ) ;
634
642
}
635
643
636
644
static struct its_vpe * its_build_vmovp_cmd (struct its_node * its ,
@@ -648,7 +656,7 @@ static struct its_vpe *its_build_vmovp_cmd(struct its_node *its,
648
656
649
657
its_fixup_cmd (cmd );
650
658
651
- return desc -> its_vmovp_cmd .vpe ;
659
+ return valid_vpe ( its , desc -> its_vmovp_cmd .vpe ) ;
652
660
}
653
661
654
662
static u64 its_cmd_ptr_to_offset (struct its_node * its ,
0 commit comments