From patchwork Sat Feb 4 20:54:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 52820 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1503586wrn; Sat, 4 Feb 2023 12:56:04 -0800 (PST) X-Google-Smtp-Source: AK7set9L1pJWVQra3qSt/1zqVMr+4cIbR/d0OB6ystmhT3TDelfDQnyFUCuc8dvHgVAigZpSDYAo X-Received: by 2002:a17:90a:bb8f:b0:22c:34a8:c5de with SMTP id v15-20020a17090abb8f00b0022c34a8c5demr15658290pjr.27.1675544164271; Sat, 04 Feb 2023 12:56:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675544164; cv=none; d=google.com; s=arc-20160816; b=u4TGPG267OtEBKnYNBc1pmBOHwO6PodbiyYKr0w6UXSFW0XvIPe6rt+ANz2SlMUCdf Ak35flm/GEVGUWVZynucdDLh5sjMjirsniVqmkqF4rCekf19khNF7+2TUoRWFPF+xSmL uOeTMN/GOLMHJA1OfS0Jmi3yn3qW4MhUi0tAJWroO9eYiT5+PF+5aDCm0Wh/jzyJUO+o 1QrqDPFqARoyefYjnCqA2E11IE7nPa/Lc40hRzFahhP62Y/YkZG4IlS1CKNeBVukKH5H racQO0QTviQJCKy/DM9TCZag1qZWDaeBktyi9kuUTP7if5uCzvC7CWO6rU9VjUpC0d4x P+yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=V9FVlEeDyjKkmVj3uzsZtxkUfh96+UJQEvrbxbqIb0o=; b=A5rROyUow7YHhdUC+t0PaDp3QdMe+OG0dzGLcRGQHeOJoiYSTHIlAHdqphnfydICk+ MxATLZvVXPO3tzBJD8r8G8/AiWlrni623ILqmsc9gAVFqeyXpv/emdqZAg0L3DiqwWQQ 7zKRnl4jieGYFes+e5NqDsDSGnDMUSARosewZoif8qpT0Ns4dh6QfJ/4xyxb1p00mTN7 7HKcQBKNP6Mqz8/Y81Q60EBEckvVIq39nCUGkchwerfWvnJyNBW9+R4ax+pEVO1TqPnW Xx+aNhL7P7HwFynry2iVxPY93NC1/AMq+C+Wu9yj6B8Wz7qKQMgeweb360g7NsG0vagA QnYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s123-20020a637781000000b004e23ebb50d1si7578927pgc.604.2023.02.04.12.55.39; Sat, 04 Feb 2023 12:56:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbjBDUy1 (ORCPT + 99 others); Sat, 4 Feb 2023 15:54:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjBDUyZ (ORCPT ); Sat, 4 Feb 2023 15:54:25 -0500 Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53CF11C337 for ; Sat, 4 Feb 2023 12:54:24 -0800 (PST) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id OPY6pZlWT5naBOPY6pVbEa; Sat, 04 Feb 2023 21:54:22 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 04 Feb 2023 21:54:22 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Gonglei , "Michael S. Tsirkin" , Jason Wang , Herbert Xu , "David S. Miller" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , virtualization@lists.linux-foundation.org, linux-crypto@vger.kernel.org Subject: [PATCH] virtio-crypto: Do not use GFP_ATOMIC when not needed Date: Sat, 4 Feb 2023 21:54:08 +0100 Message-Id: <00f487d16bf9fc5ce215c44bed3f11df5adf266a.1675544037.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756935397219997296?= X-GMAIL-MSGID: =?utf-8?q?1756935397219997296?= There is no need to use GFP_ATOMIC here. GFP_KERNEL is already used for another memory allocation just the line after. Signed-off-by: Christophe JAILLET --- This patch is speculative ! ! ! Maybe it is the other memory allocation that should use GFP_ATOMIC. Review with care ! --- drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c index b2979be613b8..6963344f6a3a 100644 --- a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c +++ b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c @@ -116,7 +116,7 @@ static int virtio_crypto_alg_akcipher_init_session(struct virtio_crypto_akcipher struct virtio_crypto_session_input *input; struct virtio_crypto_ctrl_request *vc_ctrl_req; - pkey = kmemdup(key, keylen, GFP_ATOMIC); + pkey = kmemdup(key, keylen, GFP_KERNEL); if (!pkey) return -ENOMEM;