CVE-2026-72257: ASoC: qcom: q6apm: fix NULL pointer dereference in graph_callback
In the Linux kernel, the following vulnerability has been resolved:
ASoC: qcom: q6apm: fix NULL pointer dereference in graphcallback
When q6apmfreefragments() is called it frees rxdata.buf/txdata.buf and sets them to NULL under graph->lock. A late DSP buffer-done response can race with this: graphcallback() passes the !graph->argraph guard (not yet NULL), acquires the lock, but then dereferences a now-NULL buf pointer to read buf[token].phys, crashing at virtual address 0x10.
Add a NULL check for buf inside the mutex-protected section in both the write-done (DATACMDRSPWRSHMEMEPDATABUFFERDONEV2) and read-done (DATACMDRSPRDSHMEMEPDATABUFFERV2) handlers and bail out cleanly if buffers have already been freed.
This problem is only shown up recently while apr bus was updated to process the commands per service rather from single global queue.