Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752652AbcDKKxs (ORCPT ); Mon, 11 Apr 2016 06:53:48 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:33644 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751937AbcDKKxq (ORCPT ); Mon, 11 Apr 2016 06:53:46 -0400 From: Vaishali Thakkar To: matt@codeblueprint.co.uk Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Vaishali Thakkar Subject: [PATCH] efi: Use GFP_ATOMIC instead of GFP_KERNEL Date: Mon, 11 Apr 2016 16:23:29 +0530 Message-Id: <1460372009-10785-1-git-send-email-vaishali.thakkar@oracle.com> X-Mailer: git-send-email 2.1.4 X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 757 Lines: 26 Function dup_variable_bug is called inside the spinlock. This may lead to issues when kzalloc sleeps, so it is better to use GFP_ATOMIC in this spinlocked context. Problem found using Coccinelle. Signed-off-by: Vaishali Thakkar --- drivers/firmware/efi/vars.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/vars.c b/drivers/firmware/efi/vars.c index 0ac594c..d5e2f28 100644 --- a/drivers/firmware/efi/vars.c +++ b/drivers/firmware/efi/vars.c @@ -411,7 +411,7 @@ static void dup_variable_bug(efi_char16_t *str16, efi_guid_t *vendor_guid, */ efivar_wq_enabled = false; - str8 = kzalloc(len8, GFP_KERNEL); + str8 = kzalloc(len8, GFP_ATOMIC); if (!str8) return; -- 2.1.4