Re: [PATCH v2] media: v4l2-isp: reject zero-sized parameter blocks

From: David CARLIER

Date: Wed Aug 19 2026 - 17:33:31 EST


Hi Jacopo,

On Wed, Aug 19, 2026 at 04:56:33PM +0200, Jacopo Mondi wrote:
> shouldn't we refuse the whole parameters buffer right away instead of
> ignoring the 'type' block ?

Yes, let's do that. It costs nothing either: with the header size check
the walk always makes progress, so skipping is no longer needed to avoid
the stall.

v3 keeps that check and replaces the skip with:

info = &type_info[block->type];
if (!info->size) {
dev_dbg(dev, "Unsupported block type %u at offset %zu\n",
block->type, block_offset);
return -EINVAL;
}

which also leaves the rest of the loop unindented.

Cheers.