There are various patches like that which fix this issue every time it crops up.
If you can still reproduce on the latest 6.9-rc kernels you should report a bug upstream to get the remaining cases fixed. Or if you feel comfortable you can write a patch for any remaining cases you hit. As you can see it's a trivial fix.
Variable sized arrays have fallen out of fashion.
There are various patches like that which fix this issue every time it crops up.
If you can still reproduce on the latest 6.9-rc kernels you should report a bug upstream to get the remaining cases fixed. Or if you feel comfortable you can write a patch for any remaining cases you hit. As you can see it's a trivial fix.