mISDN: Fix memory leak in dsp_pipeline_build()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 4 Mar 2022 18:25:36 +0000 (21:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Mar 2022 13:23:36 +0000 (14:23 +0100)
commit7777b1f795af1bb43867375d8a776080111aae1b
treed25388f79093e5cde71a8d41849212477ee3b9e5
parent20145e05e49721df544c0e71f67bedef4bb458aa
mISDN: Fix memory leak in dsp_pipeline_build()

[ Upstream commit c6a502c2299941c8326d029cfc8a3bc8a4607ad5 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/isdn/mISDN/dsp_pipeline.c