[ALPS05092516] block: refine bio_crypt_alloc_ctx

In bio_crypt_alloc_ctx(), check return value of mempool_alloc()
before using it.

MTK-Commit-Id: 3bbe5842f2812338b9a1f53c0f647a696e7f0c0b

Change-Id: I657d61ad1e8296269e6f91f6229b4c57ac0d189d
Signed-off-by: Light Hsieh <light.hsieh@mediatek.com>
CR-Id: ALPS05092516
Feature: [Android Default] F2FS File System
This commit is contained in:
Light Hsieh
2020-09-14 12:20:33 +08:00
committed by Stanley Chu
parent fb22c349ff
commit de31a24548

View File

@@ -49,7 +49,8 @@ struct bio_crypt_ctx *bio_crypt_alloc_ctx(gfp_t gfp_mask)
{
struct bio_crypt_ctx *bc = mempool_alloc(bio_crypt_ctx_pool, gfp_mask);
bc->hie_ext4 = false;
if (bc)
bc->hie_ext4 = false;
return bc;
}