mISDN: Fix memory leak in dsp_pipeline_build()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 4 Mar 2022 18:25:36 +0000 (21:25 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 5 Mar 2022 12:04:14 +0000 (12:04 +0000)
commitc6a502c2299941c8326d029cfc8a3bc8a4607ad5
treeceac43f3f5a0351f3724fb8960e6765de19647c9
parenta502a8f04097e038c3daa16c5202a9538116d563
mISDN: Fix memory leak in dsp_pipeline_build()

dsp_pipeline_build() allocates dup pointer by kstrdup(cfg),
but then it updates dup variable by strsep(&dup, "|").
As a result when it calls kfree(dup), the dup variable contains NULL.

Found by Linux Driver Verification project (linuxtesting.org) with SVACE.

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: 960366cf8dbb ("Add mISDN DSP")
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/mISDN/dsp_pipeline.c