On Thu, 1 Oct 2026 20:31:45 +0900 Masami Hiramatsu (Google) <[email protected]> wrote:
> > [Severity: Low] > > Does this code mix goto-based error handling and scope-based cleanup in the > > same function? > > > > The alloc_retstack_tasklist() function still contains a goto free error > > handling path earlier in its body, and a free: cleanup label at the end. > > Adding scoped_guard() here violates the kernel cleanup subsystem guidelines, > > which state that for a given routine, usage of goto and cleanup helpers > > should never be mixed. > > > > Since returning directly from within the scoped_guard() skips the free: loop > > at the end of the function, it forces manual reasoning about whether that is > > safe. This is noted in the new comment about keeping the start == end check > > in step with the exhaustion logic. > > > > Is it possible to convert the initial return stack array allocation to use > > scope-based cleanup as well, or revert to open-coded RCU read locks, to > > avoid mixing the two patterns? > > If this sends to stable kernel, I think it is better to keep using > goto in this patch, and send another cleanup later. It is allow us > to backport the patch easier. Agreed. Care to send a v4? -- Steve
