public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] bulkmem.c - null ptr fixes for 2.4.4
@ 2001-05-24 14:59 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2001-05-24 14:59 UTC (permalink / raw)
  To: Alan Cox; +Cc: Praveen Srinivasan, torvalds, linux-kernel, dhinds

Em Thu, May 24, 2001 at 03:26:20PM +0100, Alan Cox escreveu:
> > kernel code. This patch fixes numerous unchecked pointers in the PCMCIA 
> > bulkmem driver. 
> 
> Since when has two been numerous - also I dont thin the fix is right - you need
> to undo what has already been done

and anyway, 2.4.4-ac15 already has the checks, it just doesnt deallocates
what's have already been inserted in the list in setup_regions, the memory
doesn't seem to get lost, but I think its better deallocate whats been
done if it fails halfway in setup_regions.

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <fa.gocl8kv.gohl@ifi.uio.no>]
* [PATCH] bulkmem.c - null ptr fixes for 2.4.4
@ 2001-05-24  7:24 Praveen Srinivasan
  2001-05-24 14:26 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Praveen Srinivasan @ 2001-05-24  7:24 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, alan, dhinds

Hi,
Using the Stanford checker, we searched for null-pointer bugs in the linux 
kernel code. This patch fixes numerous unchecked pointers in the PCMCIA 
bulkmem driver. 

Praveen Srinivasan and Frederick Akalin

--- ../linux/./drivers/pcmcia/bulkmem.c	Tue Mar  6 19:28:32 2001
+++ ./drivers/pcmcia/bulkmem.c	Mon May  7 21:53:49 2001
@@ -229,6 +229,10 @@
 	else {
 	    erase->State = 1;
 	    busy = kmalloc(sizeof(erase_busy_t), GFP_KERNEL);
+
+	    if(busy == NULL) {
+	      return;
+	    }
 	    busy->erase = erase;
 	    busy->client = handle;
 	    init_timer(&busy->timeout);
@@ -360,6 +364,10 @@
 	if ((device.dev[i].type != CISTPL_DTYPE_NULL) &&
 	    (device.dev[i].size != 0)) {
 	    r = kmalloc(sizeof(*r), GFP_KERNEL);
+	    if(r == NULL) {
+	      return;
+	    }
+
 	    r->region_magic = REGION_MAGIC;
 	    r->state = 0;
 	    r->dev_info[0] = '\0';

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-05-25  6:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-24 14:59 [PATCH] bulkmem.c - null ptr fixes for 2.4.4 Arnaldo Carvalho de Melo
     [not found] <fa.gocl8kv.gohl@ifi.uio.no>
     [not found] ` <fa.ggh8rmv.6h4jao@ifi.uio.no>
2001-05-25  6:12   ` Praveen Srinivasan
  -- strict thread matches above, loose matches on Subject: below --
2001-05-24  7:24 Praveen Srinivasan
2001-05-24 14:26 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox