]> git.baikalelectronics.ru Git - kernel.git/commit
media: vidtv: add error checks
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 21 Sep 2020 13:11:50 +0000 (15:11 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 26 Nov 2020 06:43:40 +0000 (07:43 +0100)
commitb29b10f2600c0205b4175b97ab2999641ae6754b
tree61a614288890ceac66534306df68cf583360be42
parent3e281272a0c2e844cd1a9ac03861588828c72031
media: vidtv: add error checks

Currently, there are not checks if something gets bad during
memory allocation: it will simply use NULL pointers and
crash.

Add error path at the logic which allocates memory for the
MPEG-TS generator code, propagating the errors up to the
vidtv_bridge. Now, if something wents bad, start_streaming
will return an error that userspace can detect:

ERROR    DMX_SET_PES_FILTER failed (PID = 0x2000): 12 Cannot allocate memory

and the driver doesn't crash.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/test-drivers/vidtv/vidtv_bridge.c
drivers/media/test-drivers/vidtv/vidtv_channel.c
drivers/media/test-drivers/vidtv/vidtv_channel.h
drivers/media/test-drivers/vidtv/vidtv_mux.c
drivers/media/test-drivers/vidtv/vidtv_psi.c
drivers/media/test-drivers/vidtv/vidtv_s302m.c