@@ -1417,50 +1417,35 @@ static int nv_start_device(nv_state_t *nv, nvidia_stack_t *sp)
14171417 {
14181418 rc = os_alloc_mutex (& nvl -> isr_bh_unlocked_mutex );
14191419 if (rc != 0 )
1420- goto failed ;
1420+ goto failed_release_irq ;
14211421 nv_kthread_q_item_init (& nvl -> bottom_half_q_item , nvidia_isr_bh_unlocked , (void * )nv );
14221422 rc = nv_kthread_q_init (& nvl -> bottom_half_q , nv_device_name );
14231423 if (rc != 0 )
1424- goto failed ;
1424+ goto failed_release_irq ;
14251425 kthread_init = NV_TRUE ;
14261426
14271427 rc = nv_kthread_q_init (& nvl -> queue .nvk , "nv_queue" );
14281428 if (rc )
1429- goto failed ;
1429+ goto failed_release_irq ;
14301430 nv -> queue = & nvl -> queue ;
14311431
14321432 if (nv_platform_use_auto_online (nvl ))
14331433 {
14341434 rc = nv_kthread_q_init (& nvl -> remove_numa_memory_q ,
14351435 "nv_remove_numa_memory" );
14361436 if (rc )
1437- goto failed ;
1437+ goto failed_release_irq ;
14381438 remove_numa_memory_kthread_init = NV_TRUE ;
14391439 }
14401440 }
14411441
14421442 if (!rm_init_adapter (sp , nv ))
14431443 {
1444- if (!(nv -> flags & NV_FLAG_USES_MSIX ) &&
1445- !(nv -> flags & NV_FLAG_SOC_DISPLAY ) &&
1446- !(nv -> flags & NV_FLAG_SOC_IGPU ))
1447- {
1448- free_irq (nv -> interrupt_line , (void * ) nvl );
1449- }
1450- else if (nv -> flags & NV_FLAG_SOC_DISPLAY )
1451- {
1452- }
1453- #if defined(NV_LINUX_PCIE_MSI_SUPPORTED )
1454- else
1455- {
1456- nv_free_msix_irq (nvl );
1457- }
1458- #endif
14591444 NV_DEV_PRINTF (NV_DBG_ERRORS , nv ,
14601445 "rm_init_adapter failed, device minor number %d\n" ,
14611446 nvl -> minor_num );
14621447 rc = - EIO ;
1463- goto failed ;
1448+ goto failed_release_irq ;
14641449 }
14651450
14661451 {
@@ -1494,6 +1479,26 @@ static int nv_start_device(nv_state_t *nv, nvidia_stack_t *sp)
14941479
14951480 return 0 ;
14961481
1482+ failed_release_irq :
1483+ if (!(nv -> flags & NV_FLAG_PERSISTENT_SW_STATE ))
1484+ {
1485+ if (!(nv -> flags & NV_FLAG_USES_MSIX ) &&
1486+ !(nv -> flags & NV_FLAG_SOC_DISPLAY ) &&
1487+ !(nv -> flags & NV_FLAG_SOC_IGPU ))
1488+ {
1489+ free_irq (nv -> interrupt_line , (void * ) nvl );
1490+ }
1491+ else if (nv -> flags & NV_FLAG_SOC_DISPLAY )
1492+ {
1493+ }
1494+ #if defined(NV_LINUX_PCIE_MSI_SUPPORTED )
1495+ else
1496+ {
1497+ nv_free_msix_irq (nvl );
1498+ }
1499+ #endif
1500+ }
1501+
14971502failed :
14981503#if defined(NV_LINUX_PCIE_MSI_SUPPORTED )
14991504 if (nv -> flags & NV_FLAG_USES_MSI )
@@ -2417,6 +2422,7 @@ nvidia_ioctl(
24172422 if (arg_cmd == NV_ESC_WAIT_OPEN_COMPLETE )
24182423 {
24192424 nv_ioctl_wait_open_complete_t * params = arg_copy ;
2425+
24202426 params -> rc = nvlfp -> open_rc ;
24212427 params -> adapterStatus = nvlfp -> adapter_status ;
24222428 goto done_early ;
0 commit comments