File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -344,8 +344,6 @@ impl gpuvm::DriverGpuVm for VmInner {
344344 vm_bo : & gpuvm:: GpuVmBo < Self > ,
345345 ctx : & mut Self :: StepContext ,
346346 ) -> Result {
347- let prev_gpuva = ctx. prev_va . take ( ) . expect ( "Multiple step_remap calls" ) ;
348- let next_gpuva = ctx. next_va . take ( ) . expect ( "Multiple step_remap calls" ) ;
349347 let va = op. unmap ( ) . va ( ) . expect ( "No previous VA" ) ;
350348 let orig_addr = va. addr ( ) ;
351349 let orig_range = va. range ( ) ;
@@ -393,13 +391,21 @@ impl gpuvm::DriverGpuVm for VmInner {
393391 }
394392
395393 if let Some ( prev_op) = op. prev_map ( ) {
394+ let prev_gpuva = ctx
395+ . prev_va
396+ . take ( )
397+ . expect ( "Multiple step_remap calls with prev_op" ) ;
396398 if prev_op. map_and_link_va ( self , prev_gpuva, vm_bo) . is_err ( ) {
397399 dev_err ! ( self . dev. as_ref( ) , "step_remap: could not relink prev gpuva" ) ;
398400 return Err ( EINVAL ) ;
399401 }
400402 }
401403
402404 if let Some ( next_op) = op. next_map ( ) {
405+ let next_gpuva = ctx
406+ . next_va
407+ . take ( )
408+ . expect ( "Multiple step_remap calls with next_op" ) ;
403409 if next_op. map_and_link_va ( self , next_gpuva, vm_bo) . is_err ( ) {
404410 dev_err ! ( self . dev. as_ref( ) , "step_remap: could not relink next gpuva" ) ;
405411 return Err ( EINVAL ) ;
You can’t perform that action at this time.
0 commit comments