Skip to content

Commit 786f8e6

Browse files
KhanhNguyen-RVCthenguyenyf
authored andcommitted
drivers: video: ctrls: correct assertion in video_cluster_ctrl
The function asserted `!sz && !ctrls`, which is the inverse of the intended precondition. This caused assertion failures on valid inputs. Update the check to `sz && ctrls` so it fails only when size is zero or the control pointer is NULL. Signed-off-by: Khanh Nguyen <[email protected]>
1 parent 10a51dd commit 786f8e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/video/video_ctrls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ void video_cluster_ctrl(struct video_ctrl *ctrls, uint8_t sz)
236236
{
237237
bool has_volatiles = false;
238238

239-
__ASSERT(!sz && !ctrls, "The 1st control, i.e. the primary control, must not be NULL");
239+
__ASSERT(sz && ctrls, "The 1st control, i.e. the primary control, must not be NULL");
240240

241241
for (uint8_t i = 0; i < sz; i++) {
242242
ctrls[i].cluster_sz = sz;

0 commit comments

Comments
 (0)