lkml.org 
[lkml]   [2006]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [KJ] [PATCH] Correct misc_register return code handling in several drivers
On Tue, Oct 24, 2006 at 07:24:37AM -0600, Matthew Wilcox wrote:
> On Tue, Oct 24, 2006 at 08:53:06AM -0400, Neil Horman wrote:
> > The INIT_LIST_HEAD is there to prevent a potential oops on module removal.
> > misc_register, if it fails, leaves miscdevice.list unchanged. That means its
> > next and prev pointers contain NULL or garbage, when both pointers should contain
> > &miscdevice.list. If we don't do that, then there is a chance we will oops on
> > module removal when we do a list_del in misc_deregister on the moudule_exit
> > routine. I could have done this statically, but I thought it looked cleaner to
> > do it with the macro in the code.
>
> Maybe it would be better to have misc_register() call INIT_LIST_HEAD in
> the failure case?

Hmm, that seems reasonable. If you don't mind, since there are other unrelated
clean-ups in this patch, I'll make that change in a follow on patch. But I
think thats a good idea.

Thanks & Regards
Neil

--
/***************************************************
*Neil Horman
*Software Engineer
*gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
***************************************************/
-
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: 2006-10-24 17:15    [W:1.269 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site