Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17EB6C433F5 for ; Fri, 7 Jan 2022 03:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345855AbiAGDeW (ORCPT ); Thu, 6 Jan 2022 22:34:22 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:59076 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345090AbiAGDeU (ORCPT ); Thu, 6 Jan 2022 22:34:20 -0500 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1n5g16-0007Be-2y; Fri, 07 Jan 2022 14:34:13 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 07 Jan 2022 14:34:11 +1100 Date: Fri, 7 Jan 2022 14:34:11 +1100 From: Herbert Xu To: Jiasheng Jiang Cc: ebiggers@kernel.org, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] crypto: af_alg - check possible NULL pointer Message-ID: References: <20211231014036.1870631-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211231014036.1870631-1-jiasheng@iscas.ac.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 31, 2021 at 09:40:36AM +0800, Jiasheng Jiang wrote: > Because of the possible alloc failure of the alloc_page(), it could > return NULL pointer. > And there is a check below the sg_assign_page(). > But it will be more logical to move the NULL check before the > sg_assign_page(). > > Signed-off-by: Jiasheng Jiang > --- > Changelog: > > v1 -> v2 > > * Change 1. Move the previous check in front of sg_assign_page(). > --- > crypto/af_alg.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) Patch applied with modified Subject line. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt