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 <sudarsansamy2002@gmail.com>
This commit is contained in:
parent
672d367642
commit
cda6858d99
1 changed files with 4 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue