Document kfree and vfree NULL usage
Quoted 10 lines
Review
Quoted 8 lines
(quoted diff) +2
-3- 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.)