--- src/nvidia_subr.c.orig 2014-11-17 18:15:03.000000000 +0100 +++ src/nvidia_subr.c 2014-11-17 18:16:31.000000000 +0100 @@ -590,6 +590,10 @@ sc = nv->os_state; sp = sc->api_sp; + /* If nvidia_open_dev failed and we're called from nvidia_dev_dtor, we + * already released api_sp. */ + if (sp == NULL) + return 0; NV_PCI_CHECK_CONFIG_SPACE(sp, nv, TRUE, TRUE, TRUE); rm_free_unused_clients(sp, nv, filep);