From: Krzysztof Hałasa
The error path currently calls tw686x_video_free() which requires
vc->dev to be initialized, causing a NULL dereference on uninitizalized
channels.
Fix this by setting the vc->dev fields for all the channels first.
Fixes: f8afaa8dbc0d ("[media] tw686x: Introduce an
On 23 June 2017 at 05:18, Krzysztof Hałasa wrote:
> Hans Verkuil writes:
>
>> Any progress on this? I gather I can expect a new patch from someone?
>
> Well, the issue is trivial and very easy to test, though not present
> on common x86 hw. That patch I've
Hans Verkuil writes:
> Any progress on this? I gather I can expect a new patch from someone?
Well, the issue is trivial and very easy to test, though not present
on common x86 hw. That patch I've sent fixes it, but I'm not the one who
decides.
--
Krzysztof Halasa
Ezequiel Garcia writes:
> How about this one (untested) ?
>
> diff --git a/drivers/media/pci/tw686x/tw686x-video.c
> b/drivers/media/pci/tw686x/tw686x-video.c
> index c3fafa97b2d0..77b8d2dbd995 100644
> --- a/drivers/media/pci/tw686x/tw686x-video.c
> +++
On 11 May 2017 at 04:41, Krzysztof Hałasa wrote:
> Ezequiel Garcia writes:
>
>>> + /* Initialize vc->dev and vc->ch for the error path first */
>>> + for (ch = 0; ch < max_channels(dev); ch++) {
>>> + struct
"zhaoxuegang" writes:
> In my opinion, the oops occur to tw686x_free_dma(struct tw686x_video_channel
> *vc, unsigned int pb).
> In function tw686x_video_init, if coherent-DMA is not enough,
> tw686x_alloc_dma will failed.
> Then tw686x_video_free will be called. but
Ezequiel Garcia writes:
>> + /* Initialize vc->dev and vc->ch for the error path first */
>> + for (ch = 0; ch < max_channels(dev); ch++) {
>> + struct tw686x_video_channel *vc = >video_channels[ch];
>> + vc->dev = dev;
>> +
Hi Krzysztof,
On 10 May 2017 at 06:51, Krzysztof Hałasa wrote:
> Signed-off-by: Krzysztof Hałasa
>
> diff --git a/drivers/media/pci/tw686x/tw686x-video.c
> b/drivers/media/pci/tw686x/tw686x-video.c
> index c3fafa9..d637f47 100644
> ---
Signed-off-by: Krzysztof Hałasa
diff --git a/drivers/media/pci/tw686x/tw686x-video.c
b/drivers/media/pci/tw686x/tw686x-video.c
index c3fafa9..d637f47 100644
--- a/drivers/media/pci/tw686x/tw686x-video.c
+++ b/drivers/media/pci/tw686x/tw686x-video.c
@@ -1190,6 +1190,13 @@ int