Re: [PATCH v2] crypto: af_alg - check possible NULL pointer

From: Herbert Xu
Date: Thu Jan 06 2022 - 22:34:23 EST


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 <jiasheng@xxxxxxxxxxx>
> ---
> 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 <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt