diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2026-08-10 09:18:46 +0200 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2026-08-10 09:19:09 +0200 |
| commit | 42cf613e04c3603afa9cdba618a3e5065798e982 (patch) | |
| tree | 9f59e73fdbb60f54d5cf1f7ff9316d554ca8b8fe | |
| parent | db2ddb87143519e20a95aa36c60b36107b736a58 (diff) | |
| parent | 650c88738ae8976f46ba71b24dd8aa311adc6fde (diff) | |
Merge tag 'optee-fix-for-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into arm/fixes
Add NULL check in optee_ffa_lend_protmem()
* tag 'optee-fix-for-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee:
optee: ffa: Add NULL check in optee_ffa_lend_protmem
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
| -rw-r--r-- | drivers/tee/optee/ffa_abi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tee/optee/ffa_abi.c b/drivers/tee/optee/ffa_abi.c index b4372fa268d0..633715b98625 100644 --- a/drivers/tee/optee/ffa_abi.c +++ b/drivers/tee/optee/ffa_abi.c @@ -698,6 +698,9 @@ static int optee_ffa_lend_protmem(struct optee *optee, struct tee_shm *protmem, int rc; mem_attr = kzalloc_objs(*mem_attr, ma_count); + if (!mem_attr) + return -ENOMEM; + for (n = 0; n < ma_count; n++) { mem_attr[n].receiver = mem_attrs[n] & U16_MAX; mem_attr[n].attrs = mem_attrs[n] >> 16; |
