* [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
* Re: [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, 0 replies; 4+ messages in thread
From: Alan Cox @ 2001-05-24 14:26 UTC (permalink / raw)
To: Praveen Srinivasan; +Cc: torvalds, linux-kernel, alan, dhinds
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* 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
* Re: [PATCH] bulkmem.c - null ptr fixes for 2.4.4
[not found] ` <fa.ggh8rmv.6h4jao@ifi.uio.no>
@ 2001-05-25 6:12 ` Praveen Srinivasan
0 siblings, 0 replies; 4+ messages in thread
From: Praveen Srinivasan @ 2001-05-25 6:12 UTC (permalink / raw)
To: Alan Cox, linux-kernel
Do we need to free the linked list in setup_regions? Would it be easier to
try and preallocate the structures beforehand, and then fill them with the
loop? Btw, we didn't find anything wrong with the first part of the patch.
Praveen Srinivasan and Frederick Akalin
Alan Cox wrote:
>> 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
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ 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