Do not access NV device if not present

Prevents NULL pointer dereference on pang10 when removing module.
This commit is contained in:
Tim Crawford 2021-01-11 12:34:42 -07:00 committed by Jeremy Soller
parent 0ca551be36
commit abf92e78e3
1 changed files with 3 additions and 0 deletions

View File

@ -162,6 +162,9 @@ static int __init nv_hda_init(struct device *dev) {
} }
static void __exit nv_hda_exit(void) { static void __exit nv_hda_exit(void) {
if (dis_dev == NULL)
return;
dis_dev_get(); dis_dev_get();
nv_hda_off(); nv_hda_off();