mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
diag: Fix type cast in mempool size comparison
Fixes: af0231d9244ee70d7fee9ae479c22d82bcc95ce4 [diag: Sanitize the mempools with pool data size check] Change-Id: I31cc857e0be62c9238afa565be3dc7a3ed9f246d Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
parent
f0bc0f45b3
commit
091c0e1046
@ -181,7 +181,7 @@ void *diagmem_alloc(struct diagchar_dev *driver, int size, int pool_type)
|
||||
break;
|
||||
}
|
||||
if (size == 0 || size > mempool->itemsize ||
|
||||
size > (long)mempool->pool->pool_data) {
|
||||
size > (size_t)mempool->pool->pool_data) {
|
||||
pr_err_ratelimited("diag: cannot alloc from mempool %s, invalid size: %d\n",
|
||||
mempool->name, size);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user