summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEva Huang <evahuang@google.com>2022-01-07 21:26:06 +0800
committerEva Huang <evahuang@google.com>2022-01-07 21:26:06 +0800
commita785bd90b184f3086c5a3f86b9abfbda89d06726 (patch)
tree1853a44394a4d81adda2290811811aad8d717632
parent774ebf349f07a0d97be21f668c306011c26693e1 (diff)
parent9c592dac30db21c8b94c5cdff373ce4f595685e5 (diff)
downloadcamera-kernel-a785bd90b184f3086c5a3f86b9abfbda89d06726.tar.gz
Mar 2022.1 Bug: 204107400 Change-Id: Ia35cd4ccbbaeb1e771575f2bcf8adb42658ae9d7
-rw-r--r--drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c b/drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c
index 4d6e4a4..c27b206 100644
--- a/drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c
+++ b/drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c
@@ -728,10 +728,11 @@ static int cam_jpeg_mgr_prepare_hw_update(void *hw_mgr_priv,
}
if ((packet->num_cmd_buf > 5) || !packet->num_patches ||
- !packet->num_io_configs) {
- CAM_ERR(CAM_JPEG, "wrong number of cmd/patch info: %u %u",
- packet->num_cmd_buf,
- packet->num_patches);
+ !packet->num_io_configs ||
+ (packet->num_io_configs > CAM_JPEG_IMAGE_MAX)) {
+ CAM_ERR(CAM_JPEG, "wrong number of cmd/patch info: %u %u %u",
+ packet->num_cmd_buf, packet->num_patches,
+ packet->num_io_configs);
return -EINVAL;
}