[PATCH] tw686x: Fix oops on buffer alloc failure

2018-06-28 Thread Ezequiel Garcia
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

Re: [PATCH] TW686x: Fix OOPS on buffer alloc failure

2017-06-23 Thread Ezequiel Garcia
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

Re: [PATCH] TW686x: Fix OOPS on buffer alloc failure

2017-06-23 Thread Krzysztof Hałasa
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

Re: [PATCH] TW686x: Fix OOPS on buffer alloc failure

2017-05-11 Thread Krzysztof Hałasa
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 > +++

Re: [PATCH] TW686x: Fix OOPS on buffer alloc failure

2017-05-11 Thread Ezequiel Garcia
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

Re: [PATCH] TW686x: Fix OOPS on buffer alloc failure

2017-05-11 Thread Krzysztof Hałasa
"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

Re: [PATCH] TW686x: Fix OOPS on buffer alloc failure

2017-05-11 Thread Krzysztof Hałasa
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; >> +

Re: [PATCH] TW686x: Fix OOPS on buffer alloc failure

2017-05-10 Thread Ezequiel Garcia
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 > ---

[PATCH] TW686x: Fix OOPS on buffer alloc failure

2017-05-10 Thread Krzysztof Hałasa
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