Re: [PATCH 07/27] gpu: nova-core: add optional ucodes firmware loading

From: Timur Tabi

Date: Wed Aug 19 2026 - 13:55:55 EST


On Tue, 2026-08-18 at 20:52 -0700, John Hubbard wrote:
> +                if file.is_empty()
> +                    || matches!(file, "." | "..")
> +                    || file
> +                        .bytes()
> +                        .any(|b| b == b'/' || b == b'\\' || b.is_ascii_control())
> +                {
> +                    return Err(EINVAL);
> +                }

I'm not sure if this is needed because request_into_buf() will reject any crazy filename that
would result from an invalid FILE tag.

> +
> +                let size = usize::from_safe_cast(self.get_u32(b"SIZE")?);
> +                if size == 0 {
> +                    return Err(EINVAL); // TODO: Use ENODATA once available.
> +                }

FYI, ENODATA is already in linux-next.