From 3e50c7b1186dc8f9c68bd35e1dccccfd4aacf141 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 2 Apr 2013 17:40:38 +0200 Subject: [PATCH] Do not check for nvidia DSM on igd handle Just in case the integrated video ACPI handle cannot be found. This is a safety net for those who try bbswitch on an incompatible machine. I do not know any of such machinees, but it looks good. --- bbswitch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbswitch.c b/bbswitch.c index 7992592..11fddec 100644 --- a/bbswitch.c +++ b/bbswitch.c @@ -434,7 +434,7 @@ static int __init bbswitch_init(void) { /* At least two Acer machines are known to use the intel ACPI handle * with the legacy nvidia DSM */ dis_handle = igd_handle; - if (has_dsm_func(acpi_nvidia_dsm_muid, 0x102, 0x3)) { + if (dis_handle && has_dsm_func(acpi_nvidia_dsm_muid, 0x102, 0x3)) { dsm_type = DSM_TYPE_NVIDIA; pr_info("detected a nVidia _DSM function on the" " integrated video card\n");