• Lai Jiangshan's avatar
    futex,plist: Pass the real head of the priority list to plist_del() · 2e12978a
    Lai Jiangshan authored
    Some plist_del()s in kernel/futex.c are passed a faked head of the
    priority list.
    
    It does not fail because the current code does not require the real head
    in plist_del(). The current code of plist_del() just uses the head for checking,
    so it will not cause a bad result even when we use a faked head.
    
    But it is undocumented usage:
    
    /**
     * plist_del - Remove a @node from plist.
     *
     * @node:	&struct plist_node pointer - entry to be removed
     * @head:	&struct plist_head pointer - list head
     */
    
    The document says that the @head is the "list head" head of the priority list.
    
    In futex code, several places use "plist_del(&q->list, &q->list.plist);",
    they pass a fake head. We need to fix them all.
    
    Thanks to Darren Hart for many suggestions.
    Acked-by: default avatarDarren Hart <dvhart@linux.intel.com>
    Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
    LKML-Reference: <4D11984A.5030203@cn.fujitsu.com>
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    2e12978a
futex.c 69.1 KB