lkml.org 
[lkml]   [2021]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v5 1/6] powercap/drivers/dtpm: Move dtpm table from init to data section
    Date
    The dtpm table is used to let the different dtpm backends to register
    their setup callbacks in a single place and preventing to export
    multiple functions all around the kernel. That allows the dtpm code to
    be self-encapsulated.

    The dtpm hierarchy will be passed as a parameter by a platform
    specific code and that will lead to the creation of the different dtpm
    nodes.

    The function creating the hierarchy could be called from a module at
    init time or when it is loaded. However, at this moment the table is
    already freed as it belongs to the init section and the creation will
    lead to a invalid memory access.

    Fix this by moving the table to the data section.

    Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    ---
    include/asm-generic/vmlinux.lds.h | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
    index 42f3866bca69..50d494d94d6c 100644
    --- a/include/asm-generic/vmlinux.lds.h
    +++ b/include/asm-generic/vmlinux.lds.h
    @@ -362,7 +362,8 @@
    BRANCH_PROFILE() \
    TRACE_PRINTKS() \
    BPF_RAW_TP() \
    - TRACEPOINT_STR()
    + TRACEPOINT_STR() \
    + DTPM_TABLE()

    /*
    * Data section helpers
    @@ -723,7 +724,6 @@
    ACPI_PROBE_TABLE(irqchip) \
    ACPI_PROBE_TABLE(timer) \
    THERMAL_TABLE(governor) \
    - DTPM_TABLE() \
    EARLYCON_TABLE() \
    LSM_TABLE() \
    EARLY_LSM_TABLE() \
    --
    2.25.1
    \
     
     \ /
      Last update: 2021-12-18 14:01    [W:2.317 / U:0.104 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site