File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -340,8 +340,6 @@ impl gpuvm::DriverGpuVm for VmInner {
340340 vm_bo : & gpuvm:: GpuVmBo < Self > ,
341341 ctx : & mut Self :: StepContext ,
342342 ) -> Result {
343- let prev_gpuva = ctx. prev_va . take ( ) . expect ( "Multiple step_remap calls" ) ;
344- let next_gpuva = ctx. next_va . take ( ) . expect ( "Multiple step_remap calls" ) ;
345343 let va = op. unmap ( ) . va ( ) . expect ( "No previous VA" ) ;
346344 let orig_addr = va. addr ( ) ;
347345 let orig_range = va. range ( ) ;
@@ -389,13 +387,21 @@ impl gpuvm::DriverGpuVm for VmInner {
389387 }
390388
391389 if let Some ( prev_op) = op. prev_map ( ) {
390+ let prev_gpuva = ctx
391+ . prev_va
392+ . take ( )
393+ . expect ( "Multiple step_remap calls with prev_op" ) ;
392394 if prev_op. map_and_link_va ( self , prev_gpuva, & vm_bo) . is_err ( ) {
393395 dev_err ! ( self . dev. as_ref( ) , "step_remap: could not relink prev gpuva" ) ;
394396 return Err ( EINVAL ) ;
395397 }
396398 }
397399
398400 if let Some ( next_op) = op. next_map ( ) {
401+ let next_gpuva = ctx
402+ . next_va
403+ . take ( )
404+ . expect ( "Multiple step_remap calls with next_op" ) ;
399405 if next_op. map_and_link_va ( self , next_gpuva, & vm_bo) . is_err ( ) {
400406 dev_err ! ( self . dev. as_ref( ) , "step_remap: could not relink next gpuva" ) ;
401407 return Err ( EINVAL ) ;
You can’t perform that action at this time.
0 commit comments