[bug report] io_uring: add task fork hook

From: Dan Carpenter

Date: Fri Feb 06 2026 - 08:48:12 EST


[ Smatch checking is paused while we raise funding. #SadFace
https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]

Hello Jens Axboe,

Commit 4f08520591a2 ("io_uring: add task fork hook") from Jan 16,
2026 (linux-next), leads to the following Smatch static checker
warning:

kernel/fork.c:2544 copy_process()
warn: passing zero to 'ERR_PTR'

kernel/fork.c
2128 #ifdef CONFIG_IO_URING
2129 p->io_uring = NULL;
2130 retval = io_uring_fork(p);

The patch added this assignment.

2131 if (unlikely(retval))
2132 goto bad_fork_cleanup_delayacct;
2133 #endif
2134
2135 p->default_timer_slack_ns = current->timer_slack_ns;
2136
2137 #ifdef CONFIG_PSI
2138 p->psi_flags = 0;
2139 #endif
2140
2141 task_io_accounting_init(&p->ioac);
2142 acct_clear_integrals(p);
2143
2144 posix_cputimers_init(&p->posix_cputimers);
2145 tick_dep_init_task(p);
2146
2147 p->io_context = NULL;
2148 audit_set_context(p, NULL);
2149 cgroup_fork(p);
2150 if (args->kthread) {
2151 if (!set_kthread_struct(p))
2152 goto bad_fork_cleanup_delayacct;

So now retval is success where previously it had been -EAGAIN

2153 }

regards,
dan carpenter