lkml.org 
[lkml]   [2021]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH Part1 RFC v4 15/36] x86/mm: Add support to validate memory when changing C-bit
    On Tue, Aug 17, 2021 at 01:07:40PM -0500, Brijesh Singh wrote:
    > > > + if (!desc)
    > > > + panic("failed to allocate memory");
    > >
    > > Make that error message more distinctive so that *if* it happens, one
    > > can pinpoint the place in the code where the panic comes from.
    > >
    >
    > Now I am running checkpatch and notice that it complain about the message
    > too. I can add a BUG() or WARN() to get the stack trace before the crashing.

    checkpatch complains because there's a kmalloc before it and if it
    fails, the mm core will issue a warning so there's no need for a warning
    here.

    But in this case, you want to panic and checkpatch doesn't see that so
    you can ignore it here and leave the panic message but make it more
    distinctive so one can find it by grepping. IOW, something like

    if (!desc)
    panic("SEV-SNP: Failed to allocame memory for PSC descriptor");

    Thx.

    --
    Regards/Gruss,
    Boris.

    https://people.kernel.org/tglx/notes-about-netiquette

    \
     
     \ /
      Last update: 2021-08-17 20:18    [W:3.159 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site