media: cx25821: Fix a bug when reallocating some dma memory
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 16 Jan 2021 21:21:46 +0000 (22:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:43 +0000 (11:37 +0100)
commitf1e2ca0c11e48200eb9474e65ab4d1956a821c70
treebea8a49134d08f6a9af75df70a5bf73712e4ccbf
parentd196f0682366f548782193071c60528b2074502b
media: cx25821: Fix a bug when reallocating some dma memory

[ Upstream commit b2de3643c5024fc4fd128ba7767c7fb8b714bea7 ]

This function looks like a realloc.

However, if 'risc->cpu != NULL', the memory will be freed, but never
reallocated with the bigger 'size'.
Explicitly set 'risc->cpu' to NULL, so that the reallocation is
correctly performed a few lines below.

[hverkuil: NULL != risc->cpu -> risc->cpu]

Fixes: 5ede94c70553 ("[media] cx25821: remove bogus btcx_risc dependency)
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/pci/cx25821/cx25821-core.c