# Re: \[PATCH RESEND v2 07/23\] proc: let procfs own the seq\_file of seq\_file entries

- From: Kees Cook \<kees@kernel.org\>
- Date: 2026-11-07 16:10:30 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2026/11/17890071
- Thread: https://ratatoskr.run/linux-fsdevel/2026/11/17863636/t/3.md

```text


On November 4, 2026 11:30:58 AM PST, Christian Brauner [ref] wrote:
> [...]
>+static int pde_init_seq_direct(struct proc_dir_entry *pde)
>+{
>+	struct seq_operations *ops;
>+
>+	if (!pde_is_seq_file(pde))
>+		return 0;
>+	ops = kmalloc(sizeof(*ops), GFP_KERNEL);

Please use the new style typed allocation calls for objects:

ops = kmalloc_obj(*ops);

(This happened to jump out at me, but please check the other patches for this pattern.)

> 		dp->open = kzalloc(sizeof(*dp->open), GFP_KERNEL);

Same, etc.

-- 
Kees Cook
```
