sis_main.c
PATCH 1/1 sis_main.c
Hello,
I am a working with Dawson Englers meta compilation group at Stanford. Here is a patch for sis_main.c Basically the patch checks to see if kmalloc returns null. This patch applies to kernel version 2.4.4
Thanks,
Christopher Kanaan
sis_main.c Fri May 4 07:34:47 2001 renamed from usr/src/linux/drivers/video/sis/sis_main.c Fri Feb 9 11:30:23 2001 +5 -0
@@ -1030,6 +1030,11 @@ if (heap.pohFreeList == NULL) { poha = kmalloc(OH_ALLOC_SIZE, GFP_KERNEL); + if(!poha) + { + return(NULL); + } + poha->pohaNext = heap.pohaChain; heap.pohaChain = poha;
Quoted 4 lines · Christopher Kanaan
Hello,
I am a working with Dawson Englers meta compilation group at Stanford. Here is a patch forsis_main.cBasically the patch checks to see if kmalloc returns null. This patch applies to kernel version 2.4.4
Great, but why not follow Documentation/CodingStyle, and the example set by the rest of the file?!
Instead of:
sis_main.c Fri May 4 07:34:47 2001 line 1039
Quoted 13 lines
sis_main.c Fri May 4 07:34:47 2001 renamed from usr/src/linux/drivers/video/sis/sis_main.c Fri Feb 9 11:30:23 2001 +5
-0@@ -1030,6 +1030,11 @@ if (heap.pohFreeList == NULL) { poha = kmalloc(OH_ALLOC_SIZE, GFP_KERNEL); + if(!poha) + { + return(NULL); + } + poha->pohaNext = heap.pohaChain; heap.pohaChain = poha;
Something like this:
if (heap.pohFreeList == NULL) {
poha = kmalloc(OH_ALLOC_SIZE, GFP_KERNEL);+ if (!poha) {
+ return(NULL);
+ }
+
poha->pohaNext = heap.pohaChain;
heap.pohaChain = poha;/David Weinehall
_ _
// David Weinehall <[email protected]> /> Northern lights wander \\
// Project MCA Linux hacker // Dance across the winter sky // \> http://www.acc.umu.se/~tao/ </ Full colour fire </