Author: dchapyshev
Date: Thu Sep 3 17:30:38 2009
New Revision: 42990
URL:
http://svn.reactos.org/svn/reactos?rev=42990&view=rev
Log:
- Handle memory allocation failure. Found by amine48rz
Modified:
trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.c
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/mouse.c [iso-8859-1] Thu Sep 3 17:30:38
2009
@@ -40,6 +40,12 @@
pdriver->driver_desc.dev_protocol = 2; // Protocol Info.
pdriver->driver_ext = usb_alloc_mem(NonPagedPool, sizeof(MOUSE_DRVR_EXTENSION));
+ if (!pdriver->driver_ext)
+ {
+ usb_dbg_print(DBGLVL_MAXIMUM, ("mouse_driver_init(): memory allocation
failed!\n"));
+ return FALSE;
+ }
+
pdriver->driver_ext_size = sizeof(MOUSE_DRVR_EXTENSION);
RtlZeroMemory(pdriver->driver_ext, sizeof(MOUSE_DRVR_EXTENSION));