unsigned int fmt;
int ret = 0;
+ /*
+ * NOTE
+ *
+ * snd_pcm_hw_params is quite large (608 bytes on arm64) and is
+ * starting to get a bit excessive for allocation on the stack,
+ * especially when you're building with some of the KASAN type
+ * stuff that increases stack usage.
+ * So, we use kzalloc()/kfree() for params in this function.
+ */
params = kzalloc(sizeof(*params), GFP_KERNEL);
if (!params)
return -ENOMEM;
runtime->rate = params_rate(params);
out:
+ /* see above NOTE */
kfree(params);
+
return ret;
}