• Ingo Molnar's avatar
    x86, PEBS/DS: fix code flow in ds_request() · 10db4ef7
    Ingo Molnar authored
    this compiler warning:
    
      arch/x86/kernel/ds.c: In function 'ds_request':
      arch/x86/kernel/ds.c:368: warning: 'context' may be used uninitialized in this function
    
    Shows that the code flow in ds_request() is buggy - it goes into
    the unlock+release-context path even when the context is not allocated
    yet.
    
    First allocate the context, then do the other checks.
    
    Also, take care with GFP allocations under the ds_lock spinlock.
    
    Cc: <stable@kernel.org>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    10db4ef7
ds.c 20.5 KB