Re: [PATCH v4 4/7] drm/xe/sysctrl: Use xe_assert() for payload size validation
Michal Wajdeczko <[email protected]>
| Newsgroups | org.freedesktop.lists.intel-xe |
|---|---|
| Message-ID | <[email protected]> |
On 8/20/2026 12:16 PM, Mallesh Koujalagi wrote: > Replace the runtime payload length check with xe_assert(), > as oversized messages should never reach code path. > > Signed-off-by: Mallesh Koujalagi <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> > --- > drivers/gpu/drm/xe/xe_sysctrl_mailbox.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c > index ac58571f2a43..c043b51cacc8 100644 > --- a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c > +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c > @@ -105,10 +105,7 @@ static int sysctrl_prepare_command(struct xe_device *xe, > > xe_assert(xe, command <= SYSCTRL_HDR_COMMAND_MAX); > > - if (data_in_len > XE_SYSCTRL_MB_MAX_MESSAGE_SIZE - sizeof(*hdr)) { > - xe_err(xe, "sysctrl: Input data too large: %zu bytes\n", data_in_len); > - return -EINVAL; > - } > + xe_assert(xe, data_in_len <= XE_SYSCTRL_MB_MAX_MESSAGE_SIZE - sizeof(*hdr)); > > size = sizeof(*hdr) + data_in_len; >