From cda6858d9914d4e2343f1db19ac8476530121767 Mon Sep 17 00:00:00 2001 From: sudarsan N Date: Wed, 11 Jun 2025 11:59:00 +0530 Subject: [PATCH] drivers: video: fix null deref in video_get_csi_link_freq() Add null and bounds checks before accessing int_menu[ctrl.val]. CID: 525179 Fixes: #91244 Signed-off-by: sudarsan N --- drivers/video/video_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/video/video_common.c b/drivers/video/video_common.c index 3a30dc7a260..dd111b3c963 100644 --- a/drivers/video/video_common.c +++ b/drivers/video/video_common.c @@ -419,6 +419,10 @@ int64_t video_get_csi_link_freq(const struct device *dev, uint8_t bpp, uint8_t l return -ERANGE; } + if (ctrl_query.int_menu == NULL) { + return -EINVAL; + } + return (int64_t)ctrl_query.int_menu[ctrl.val]; fallback: