lkml.org 
[lkml]   [2006]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3/3] Assert notifier_block and notifier_call are not in init section
    Andrew,

    Feel free to drop this patch if you think it is not needed.

    regards,

    chandra
    --

    This patch ASSERTS that the notifier_block data structure and the
    notifier_call funtion are not in the init section.

    --
    Signed-Off-By: Chandra Seetharaman <sekharan@us.ibm.com>

    sys.c | 7 +++++++
    1 files changed, 7 insertions(+)

    Index: linux-2617-rc2/kernel/sys.c
    ===================================================================
    --- linux-2617-rc2.orig/kernel/sys.c 2006-04-24 11:29:30.000000000 -0700
    +++ linux-2617-rc2/kernel/sys.c 2006-04-24 11:36:35.000000000 -0700
    @@ -97,6 +97,11 @@ int cad_pid = 1;

    static BLOCKING_NOTIFIER_HEAD(reboot_notifier_list);

    +static inline int addr_in_init_section(void *addr)
    +{
    + return ((addr >= (void *)__init_begin) && (addr < (void *)__init_end));
    +}
    +
    /*
    * Notifier chain core routines. The exported routines below
    * are layered on top of these, with appropriate locking added.
    @@ -105,6 +110,8 @@ static BLOCKING_NOTIFIER_HEAD(reboot_not
    static int notifier_chain_register(struct notifier_block **nl,
    struct notifier_block *n)
    {
    + BUG_ON(addr_in_init_section(n)
    + || addr_in_init_section(n->notifier_call));
    while ((*nl) != NULL) {
    if (n->priority > (*nl)->priority)
    break;
    --

    ----------------------------------------------------------------------
    Chandra Seetharaman | Be careful what you choose....
    - sekharan@us.ibm.com | .......you may get it.
    ----------------------------------------------------------------------
    -
    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-04-25 04:38    [W:0.021 / U:31.408 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site