lkml.org 
[lkml]   [2004]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Document kfree and vfree NULL usage
>> -	if (mfile) {
>> - kfree(mfile);
>> - } else {
>> + kfree(mfile);
>> + if (!mfile) {
>> snd_printk(KERN_ERR "ALSA card file remove problem (%p)\n", file);
>> return -ENOENT;
>> }

> The above change seems to always trigger the ENOENT return, no?

No. kfree(mfile) doesn't magically change the numerical value of mfile.
Dereferencing it now would be a bad idea, but you can still look at it.

(The ANSI C standard envisions architectures on which just *looking* at
a dangling pointer is illegal, but Linux makes slightly tighter
restrictions.)
-
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/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.030 / U:1.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site