On Mon, 10 Jun 2002 17:28, Brad Hards wrote:
> These are some of the usb relevant bugs from the latest round of checker
> reports, posted to lkml. I compared these reports to 2.4.19-pre10 and
> 2.5.21. Patches are _compile_ tested only, but look good to me. Please
> review and consider merging upstream, ideally before 2.4.19.
<snip>
> bradh: Null check added for width and height. This needs to go into 2.5
> too, but I haven't done that yet.
Patch for 2.5.21 attached, for se401 fixes.

Brad
diff -Naur -X dontdiff linux-2.5.21/drivers/usb/media/se401.c linux-2.5.21-checker/drivers/usb/media/se401.c
--- linux-2.5.21/drivers/usb/media/se401.c	Sun Jun  9 15:28:44 2002
+++ linux-2.5.21-checker/drivers/usb/media/se401.c	Mon Jun 10 18:50:38 2002
@@ -1330,7 +1330,13 @@
 
 	se401->sizes=cp[4]+cp[5]*256;
 	se401->width=kmalloc(se401->sizes*sizeof(int), GFP_KERNEL);
+	if (NULL == (se401->width))
+		return 1;
 	se401->height=kmalloc(se401->sizes*sizeof(int), GFP_KERNEL);
+	if (NULL == (se401->height)) {
+		kfree(se401->width);
+		return 1;
+	}
 	for (i=0; i<se401->sizes; i++) {
 		    se401->width[i]=cp[6+i*4+0]+cp[6+i*4+1]*256;
 		    se401->height[i]=cp[6+i*4+2]+cp[6+i*4+3]*256;

Reply via email to