>Amit Choudhary <[EMAIL PROTECTED]> wrote:
>> --- Christoph Hellwig <[EMAIL PROTECTED]> wrote:
>>> On Sun, Jan 07, 2007 at 12:46:50AM -0800, Amit Choudhary wrote:
>> Any strong reason why not? x has some value that does not make sense and can
>> create
Description: Check the return value of kmalloc() in function
videocodec_build_table(), in file drivers/media/video/videocodec.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/media/video/videocodec.c b/drivers/media/video/videocodec.c
index 290e641..f2bbd7a 100644
Description: Check the return value of kmalloc() in function
se401_start_stream(), in file drivers/media/video/se401.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index 7aeec57..006c818 100644
--- a/drivers
Description: Check the return value of kmalloc() in function
stv680_start_stream(), in file drivers/media/video/stv680.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 6d1ef1e..f35c664 100644
--- a/drivers
Hi,
Is there any debug option where I get some memory (from kmalloc() family) for
limited time only.
Once the time slice expires, that memory is zeroed out so that if I use it
again after the time
slice expired, I should see a crash.
-Amit
___
Description: Check the return value of kmalloc() in function
se401_start_stream(), in file drivers/media/video/se401.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index 7aeec57..006c818 100644
--- a/drivers
Description: Check the return value of kmalloc() in function con_init(), in
file drivers/char/vt.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 87587b4..6aa08cb 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -
Description: Fix error-path leak in function jffs2_scan_medium(), in file
fs/jffs2/scan.c
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index e241346..cd9ed6e 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -130,6 +130,8 @@
Description: Check the return value of kmalloc() in function agp_sgi_init(), in
file drivers/char/agp/sgi-agp.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c
index d73be4c..5897e6c 100644
--- a/drivers/char/agp/sgi
Description: Check the return value of kmalloc() in function dbg_kmalloc(), in
file net/wanrouter/wanmain.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 316211d..263450c 100644
--- a/net/wanrouter/wanmain.c
+++
Description: Change in error message in function fore200e_kmalloc(), in file
drivers/atm/fore200e.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 3a7b21f..1c7ea02 100644
--- a/drivers/atm/fore200e.c
+++ b/drive
Description: Check the return value of kmalloc() in function
mgsl_alloc_intermediate_txbuffer_memory(), in file drivers/char/synclink.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index 06784ad..24f99bc 100644
--- a/d
Description: Check the return value of kmalloc() in function i810_open(), in
file sound/oss/i810_audio.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index 240cc79..a415967 100644
--- a/sound/oss/i810_audio.c
+++ b/sou
Description: Check the return value of kmalloc() in function
wrandom_set_nhinfo(), in file net/ipv4/multipath_wrandom.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/net/ipv4/multipath_wrandom.c b/net/ipv4/multipath_wrandom.c
index 92b0482..bcdb1f1 100644
--- a/ne
Description: Check the return value of kmalloc() in function
stv680_start_stream(), in file drivers/media/video/stv680.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 6d1ef1e..f35c664 100644
--- a/drivers
Description: Check the return value of kmalloc() in function setup_cpu_cache(),
in file mm/slab.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/mm/slab.c b/mm/slab.c
index 84c631f..613ae61 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2021,6 +2021,7 @@ static int setup_cpu
Description: Check the return value of kmalloc() in function cifs_readdir(), in
file fs/cifs/readdir.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index b5b0a2a..2d43b2a 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -
Description: Check the return value of kmalloc() in function mos7840_get_reg(),
in file drivers/usb/serial/mos7840.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 021be39..91d474b 100644
--- a/drivers/usb/
Description: Check the return value of kmalloc() in function
stv680_start_stream(), in file drivers/media/video/stv680.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 6d1ef1e..a1ec3ac 100644
--- a/drivers
Description: Check the return value of kmalloc() in function ch_readconfig(),
in file drivers/scsi/ch.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
index f6caa43..fcd635b 100644
--- a/drivers/scsi/ch.c
+++ b/drivers/scsi/ch.c
@@
Description: Check the return value of kmalloc() in function
videocodec_build_table(), in file drivers/media/video/videocodec.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/media/video/videocodec.c b/drivers/media/video/videocodec.c
index 2ae3fb2..16fc1dd 100644
--- Randy Dunlap <[EMAIL PROTECTED]> wrote:
> On Tue, 9 Jan 2007 11:02:35 -0800 (PST) Amit Choudhary wrote:
>
> No thanks. If a driver author wants to maintain driver state
> that way, it's OK, but that doesn't make it a global requirement.
>
Ok. So,
--- [EMAIL PROTECTED] wrote:
> On Tue, 09 Jan 2007 11:02:35 PST, Amit Choudhary said:
> > Correct. And doing kfree(x); x=NULL; is not hiding that. These issues can
> > still be debugged by
> > using the slab debugging options. One other benefit of doing this is that
&g
--- [EMAIL PROTECTED] wrote:
> On Mon, 08 Jan 2007 01:06:12 PST, Amit Choudhary said:
> > I do not see how a double free can result in _logical_wrong_behaviour_ of
> > the program and the
> > program keeps on running (like an incoming packet being dropped because of
>
--- Pekka Enberg <[EMAIL PROTECTED]> wrote:
> Hi Amit,
>
> On 1/8/07, Amit Choudhary <[EMAIL PROTECTED]> wrote:
> > Man, doesn't make sense to me.
>
> Well, man, double-free is a programming error and papering over it
> with NULL initializations bloats
--- Sumit Narayan <[EMAIL PROTECTED]> wrote:
> Asking for KFREE is as silly as asking for a macro to check if kmalloc
> succeeded for a pointer, else return ENOMEM.
>
> #define CKMALLOC(p,x) \
>do { \
>p = kmalloc(x, GFP_KERNEL); \
>if(!p) return -ENOMEM; \
> } while(0)
--- Vadim Lobanov <[EMAIL PROTECTED]> wrote:
> On Sun, 2007-01-07 at 23:29 -0800, Amit Choudhary wrote:
> > I do not want to write this but I think that you are arguing just for the
> > heck of it. Please
> be
> > sane.
>
> No, I'm merely trying to
--- Pekka Enberg <[EMAIL PROTECTED]> wrote:
> On 1/8/07, Hua Zhong <[EMAIL PROTECTED]> wrote:
> > > And as I explained, it can result in longer code too. So, why
> > > keep this value around. Why not re-initialize it to NULL.
> >
> > Because initialization increases code size.
>
> And it also ef
--- Hua Zhong <[EMAIL PROTECTED]> wrote:
> > Any strong reason why not? x has some value that does not
> > make sense and can create only problems.
>
> By the same logic, you should memset the buffer to zero before freeing it too.
>
How does this help?
> > And as I explained, it can result i
--- Vadim Lobanov <[EMAIL PROTECTED]> wrote:
> On Sun, 2007-01-07 at 20:09 -0800, Amit Choudhary wrote:
> > I have already explained it earlier. I will try again. You will not need
> > free_2: and free_1:
> with
> > KFREE(). You will only need one free: with KFR
--- Vadim Lobanov <[EMAIL PROTECTED]> wrote:
>
> struct type1 {
> /* something */
> };
>
> struct type2 {
> /* something */
> };
>
> #define COUNT 10
>
> void function1(struct type1 **a1, struct type2 **a2, unsigned int sz);
>
> void function2(void)
> {
> struct type1 *arr1
--- Vadim Lobanov <[EMAIL PROTECTED]> wrote:
> On Sun, 2007-01-07 at 14:43 -0800, Amit Choudhary wrote:
> > Any strong reason why not? x has some value that does not make sense and
> > can create only
> problems.
> > And as I explained, it can result in long
--- Christoph Hellwig <[EMAIL PROTECTED]> wrote:
> On Sun, Jan 07, 2007 at 12:46:50AM -0800, Amit Choudhary wrote:
> > Well, I am not proposing this as a debugging aid. The idea is about correct
> > programming,
> atleast
> > from my view. Ideally, if you kfree(x),
--- Rene Herman <[EMAIL PROTECTED]> wrote:
>
>If we're limited to Linux kernels, this seems to not be the case. Great care
>is taken in keeping
>this userspace ABI stable -- new system calls are given new numbers. Old
>system calls may
>disappear (after a long grace period) but even then I don't
>>On 1/1/07, Amit Choudhary <[EMAIL PROTECTED]> wrote:
>>+#define KFREE(x) \
>>+ do { \
>>+ kfree(x); \
>>+ x = NULL; \
>>+ } while(0)
>>NAK until you have actual callers for it. CONFIG_SLAB_DEBUG already
>>catches use
Hi,
I wanted to know if there is any inclination towards making system calls more
portable. Please let
me know if this discussion has happened before.
Well, system calls today are not portable mainly because they are invoked using
a number and it
may happen that a number 'N' may refer to system
Description: new KFREE() macro to set the variable NULL after freeing it.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 1ef822e..28da74c 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -75,6 +75,12 @
--- Ingo Oeser <[EMAIL PROTECTED]> wrote:
> On Sunday, 31. December 2006 14:38, Bernd Petrovitsch wrote:
> > That depends on the decision/definition if (so called) "double free" is
> > an error or not (and "free(NULL)" must work in POSIX-compliant
> > environments).
>
> A double free of non-NULL
Description: new KFREE() macro to set the variable NULL after freeing it.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 1ef822e..28da74c 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -75,6 +75,12 @
Description: Check the return value of kmalloc() in function agp_sgi_init(), in
file drivers/char/agp/sgi-agp.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c
index d73be4c..5897e6c 100644
--- a/drivers/char/agp/sgi
*aligned_kmalloc (int size, gfp_t flags,
int alignment).
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 9c67df5..2ba6b2e 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1385,7 +1385,7 @@ static void __d
Description: Fix error-path leak in function jffs2_scan_medium(), in file
fs/jffs2/scan.c
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index e241346..cd9ed6e 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -130,6 +130,8 @@
Hi,
Was just wondering if the _var_ in kfree(_var_) could be set to NULL after its
freed. It may solve
the problem of accessing some freed memory as the kernel will crash since _var_
was set to NULL.
Does this make sense? If yes, then how about renaming kfree to something else
and providing a
Description: Check the return value of kmalloc() in function con_init(), in
file drivers/char/vt.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 87587b4..6aa08cb 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -
Description: Check the return value of kmalloc() in function dbg_kmalloc(), in
file net/wanrouter/wanmain.c.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 316211d..263450c 100644
--- a/net/wanrouter/wanmain.c
+++
recover.
Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
diff --git a/drivers/media/video/cpia2/cpia2_usb.c
b/drivers/media/video/cpia2/cpia2_usb.c
index 28dc6a1..c938638 100644
--- a/drivers/media/video/cpia2/cpia2_usb.c
+++ b/drivers/media/video/cpia2/cpia2_usb.c
@@ -640,6 +640,10 @@ stat
46 matches
Mail list logo