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,15 @@ impl gpuvm::DriverGpuVm for VmInner {
389387 }
390388
391389 if let Some ( prev_op) = op. prev_map ( ) {
390+ let prev_gpuva = ctx. prev_va . take ( ) . expect ( "Multiple step_remap calls with prev_op" ) ;
392391 if prev_op. map_and_link_va ( self , prev_gpuva, & vm_bo) . is_err ( ) {
393392 dev_err ! ( self . dev. as_ref( ) , "step_remap: could not relink prev gpuva" ) ;
394393 return Err ( EINVAL ) ;
395394 }
396395 }
397396
398397 if let Some ( next_op) = op. next_map ( ) {
398+ let next_gpuva = ctx. next_va . take ( ) . expect ( "Multiple step_remap calls with next_op" ) ;
399399 if next_op. map_and_link_va ( self , next_gpuva, & vm_bo) . is_err ( ) {
400400 dev_err ! ( self . dev. as_ref( ) , "step_remap: could not relink next gpuva" ) ;
401401 return Err ( EINVAL ) ;
You can’t perform that action at this time.
0 commit comments