Re: [PATCH 1/2] media: rcar-isp: Account for the header in the ConfigDMA bounds check
From: Niklas Söderlund
Date: Wed Dec 02 2026 - 11:44:12 EST
On 2026-12-03 01:38:31 +0900, Hyeonjun Hong wrote:
> Hi Niklas,
>
> Thanks for the review.
>
> On 2026-12-02 17:26:45 +0100, Niklas Söderlund wrote:
> > Nice catch, but could you move the magic values to defines, maybe
> > something like,
> >
> > #define RISP_IO_PARAMS_HEADER_SIZE 8
> > #define RISP_IO_PARAMS_MAX_PAIRS ((RISP_IO_PARAMS_BUF_SIZE - RISP_IO_PARAMS_HEADER_SIZE) / 8)
d00h this should have been / 16, not / 8. Maybe add a define for that
too, RISP_IO_PARAMS_PAIR_SIZE and use that ;-)
> >
> > And use them here?
>
> Will do in v2. The check then becomes
>
> if (desc->count >= RISP_IO_PARAMS_MAX_PAIRS)
> return -ENOMEM;
>
> and I will also update the comment above RISP_IO_PARAMS_BUF_SIZE, which
> says 2048 pairs.
>
> One related question, also in the cover letter: risp_core_job_prepare()
> in core.c rejects the buffer if
>
> pairs > (RISP_IO_PARAMS_BUF_SIZE - 8) / 16
>
> which is 1023, i.e. it counts 16 bytes per pair. Should that become
> RISP_IO_PARAMS_MAX_PAIRS as well? If so I can add a patch for it to v2.
Most likely.
>
> Thanks,
> Hyeonjun
--
Kind Regards,
Niklas Söderlund