mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
Merge "soc: qcom: hab: add the buffer size sanity check for exporting a buffer"
This commit is contained in:
commit
df0f2b21c8
1 changed files with 3 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#include "hab.h"
|
||||
#include "hab_grantable.h"
|
||||
|
|
@ -241,7 +241,8 @@ int hab_mem_export(struct uhab_context *ctx,
|
|||
int page_count;
|
||||
int compressed = 0;
|
||||
|
||||
if (!ctx || !param || !param->buffer)
|
||||
if (!ctx || !param || !param->buffer || !param->sizebytes
|
||||
|| ((param->sizebytes % PAGE_SIZE) != 0))
|
||||
return -EINVAL;
|
||||
|
||||
vchan = hab_get_vchan_fromvcid(param->vcid, ctx, 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue