Received: by 10.223.185.116 with SMTP id b49csp3944050wrg; Tue, 13 Feb 2018 10:08:07 -0800 (PST) X-Google-Smtp-Source: AH8x224kxJ5SjNwNuf6nfP64VHXmbTiL6qVufAD7CF6bpl6dxmWbRhO0xvk4QedML+rNQBVeN9i5 X-Received: by 2002:a17:902:6b05:: with SMTP id o5-v6mr1872196plk.179.1518545287025; Tue, 13 Feb 2018 10:08:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518545286; cv=none; d=google.com; s=arc-20160816; b=Q5pQ8BJkxHKmxA4r5q2m/ayn1zvrkwVcj67jphg7XzILqjgmmYPqCJD/k/x/K4knG6 UnetA2oP4qz7iFT9IXZQ2octaqvP4DmRGNng1QXiCddKyMmfmejl2FU4UNzl7kLzTNjM 6SIROMqNcA/fffXc1QKbE0J5SIrVHlFLO3AUXn5syYq/DURL3D5oAE48t9Gr4wr3udvt hqItQUItou0Oz5MkElYVdSWtu6mPrrRmom9Y1Xe653jiuTkMoHkBV8qT+QcwFFCsMoOc LF+2k+8MYN3jV/vJ7hmGaDJEnWY2xaLKpa9R1nP++y5VYJo30M2eEvY52Y2euXHEn1CG fCTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=p88gFcOKZzmIdOeOtbDEAMLnJecTo4QRJLVtCWdtfYQ=; b=YuHkd4bEOTun8kfRZ9H6hiN5Oh3curMPXoJASjX1Bn1GXsMHpVnOxenRgzfvqDjmD3 r3UZKRrZRNOzYe9NKRv8iQHp4hSUQa19XJrdHycCDZtEtXJfJ8bZAvg09FFEbvh4B1Ob FzNJaKDvHZIpq82OUUHpw/8eHb/pBOXZwOxJYNkywlFBeUMtyjOiwvCpuGNzMJK8qlMi X8HrFKOehjZ+Q2fxmlUSbiizZpp2n6y4b8ULToVNnMquXnMwPSoHaz87lZDRQu9NRLhQ 95okoxdah0ruIukXOomsMJjMtrteYF1LXTe4QdyB7tms/f5aNHOhEPR1y6qF7vlXq9jR 6JbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Ifse/xIw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21-v6si2555321plj.194.2018.02.13.10.07.52; Tue, 13 Feb 2018 10:08:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Ifse/xIw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965391AbeBMSHO (ORCPT + 99 others); Tue, 13 Feb 2018 13:07:14 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:38637 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965168AbeBMSHM (ORCPT ); Tue, 13 Feb 2018 13:07:12 -0500 Received: by mail-wm0-f66.google.com with SMTP id 141so17545794wme.3; Tue, 13 Feb 2018 10:07:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=p88gFcOKZzmIdOeOtbDEAMLnJecTo4QRJLVtCWdtfYQ=; b=Ifse/xIwx077JKQZ/8F6iE7sCPppHAvaJm7WJpQi5zMnqsqwOGgNGRDC3qbaOa/jtz xDaHbI3X8yXFzWxUwMvLTe4t6C1Mir4dPFeVxRV+II5Sww4mH+AOH9VAl+eeI35QvS5l fFH2UyZ2emHUnxgx2ycstRQOStMp0cBMeF5SqtJuyk8N6sr9+8Y6K1+r5oQjHiQYmkHK Z9vRVT7dtWa6NUj+slMRh+v5w7O+JkFdfCObKiYxqOxdksFCu4J4+W+TsRNKf34UcXYD bx0rbfR/YzJupfZ8gqYJTxJhW8F/5O8qYk4FtrmEnBflUVsq4kLyQzlD06tr3k6C87oD vbhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=p88gFcOKZzmIdOeOtbDEAMLnJecTo4QRJLVtCWdtfYQ=; b=J13NagrK+NG6FOG+9kt/f+jE1AjuBxwyz7bZeE/rko73oH++4Hzxcn0pYbobbzauNb jDPhuoxk1dTUs50lqxGGjVtlFc9+jXLwaq7IdnVyXmqk/baHM7EMJtnk41ELhlfjtPHv d8lg3ezQql46tSPXZdPGjma3Audm9mWPnHw4z5CQr4YbDUPuk0yaEscYvkBkjxsQzHWy dgW26mM7GRTFhmddgWAORITKMQhWZvL/Zo7yiaRVLaZ1ScKuFWwfmUO+dN9zOELgOayj nxPqe4Jcrxkl0r0fqgfKU/S7uVSHKFAgu7rfwy4z5XeCvgbNc9334wDabqP0HC+jH+2n kZeA== X-Gm-Message-State: APf1xPB4PMHHsQqeiVLwSM3rXcSTbrQKpfJMHeN54SArgSNwMFfs3vIr gBBmlGE1cBUTkNM4XiQXtpg= X-Received: by 10.28.23.14 with SMTP id 14mr2113137wmx.5.1518545231346; Tue, 13 Feb 2018 10:07:11 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id k37sm17546416wrf.92.2018.02.13.10.07.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2018 10:07:10 -0800 (PST) Date: Tue, 13 Feb 2018 19:07:08 +0100 From: Ingo Molnar To: Jia-Ju Bai Cc: matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86: efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store Message-ID: <20180213180707.einsznaoghtctkqn@gmail.com> References: <1516847386-5291-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516847386-5291-1-git-send-email-baijiaju1990@gmail.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Jia-Ju Bai wrote: > The function kzalloc here is not called in atomic context. > If nonblocking in efi_query_variable_store is true, > namely it is in atomic context, efi_query_variable_store will return before > this kzalloc is called. > Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. > > This is found by a static analysis tool named DCNS written by myself. > > Signed-off-by: Jia-Ju Bai > --- > arch/x86/platform/efi/quirks.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c > index 8a99a2e..b6dcb52 100644 > --- a/arch/x86/platform/efi/quirks.c > +++ b/arch/x86/platform/efi/quirks.c > @@ -177,7 +177,7 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size, > * that by attempting to use more space than is available. > */ > unsigned long dummy_size = remaining_size + 1024; > - void *dummy = kzalloc(dummy_size, GFP_ATOMIC); > + void *dummy = kzalloc(dummy_size, GFP_KERNEL); Looks good to me! Reviewed-by: Ingo Molnar Thanks, Ingo