patch-2.3.99-pre6 linux/drivers/char/joystick/joystick.c

Next file: linux/drivers/char/misc.c
Previous file: linux/drivers/char/ip2main.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/drivers/char/joystick/joystick.c linux/drivers/char/joystick/joystick.c
@@ -516,7 +516,9 @@
 
 	MOD_INC_USE_COUNT;
 
-	if ((new = kmalloc(sizeof(struct js_list), GFP_KERNEL))) {
+	new = kmalloc(sizeof(struct js_list), GFP_KERNEL);
+	if (!new) {
+		jd->close(jd);
 		MOD_DEC_USE_COUNT;
 		return -ENOMEM;
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)