Browse Source

Check for presence of driver name in DRIVER_COUNT_FOUND to prevent strcmp on a null pointer when a driver is not built in.

Con Kolivas 12 years ago
parent
commit
32bc746178
1 changed files with 1 additions and 1 deletions
  1. 1 1
      usbutils.c

+ 1 - 1
usbutils.c

@@ -3140,7 +3140,7 @@ void usb_cleanup()
 	cgsem_destroy(&usb_resource_sem);
 	cgsem_destroy(&usb_resource_sem);
 }
 }
 
 
-#define DRIVER_COUNT_FOUND(X) if (strcasecmp(ptr, X##_drv.name) == 0) { \
+#define DRIVER_COUNT_FOUND(X) if (X##_drv.name && strcasecmp(ptr, X##_drv.name) == 0) { \
 	drv_count[X##_drv.drv_id].limit = lim; \
 	drv_count[X##_drv.drv_id].limit = lim; \
 	found = true; \
 	found = true; \
 	}
 	}