linux/drivers/media/dvb-core
Arnd Bergmann 14e3cdbb00 media: don't drop front-end reference count for ->detach
A bugfix introduce a link failure in configurations without CONFIG_MODULES:

In file included from drivers/media/usb/dvb-usb/pctv452e.c:20:0:
drivers/media/usb/dvb-usb/pctv452e.c: In function 'pctv452e_frontend_attach':
drivers/media/dvb-frontends/stb0899_drv.h:151:36: error: weak declaration of 'stb0899_attach' being applied to a already existing, static definition

The problem is that the !IS_REACHABLE() declaration of stb0899_attach()
is a 'static inline' definition that clashes with the weak definition.

I further observed that the bugfix was only done for one of the five users
of stb0899_attach(), the other four still have the problem.  This reverts
the bugfix and instead addresses the problem by not dropping the reference
count when calling '->detach()', instead we call this function directly
in dvb_frontend_put() before dropping the kref on the front-end.

I first submitted this in early 2018, and after some discussion it
was apparently discarded.  While there is a long-term plan in place,
that plan is obviously not nearing completion yet, and the current
kernel is still broken unless this patch is applied.

Link: https://patchwork.kernel.org/patch/10140175/
Link: https://patchwork.linuxtv.org/patch/54831/

Cc: Max Kellermann <max.kellermann@gmail.com>
Cc: Wolfgang Rohdewald <wolfgang@rohdewald.de>
Cc: stable@vger.kernel.org
Fixes: f686c14364 ("[media] stb0899: move code to "detach" callback")
Fixes: 6cdeaed3b1 ("media: dvb_usb_pctv452e: module refcount changes were unbalanced")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-08-04 06:33:11 -03:00
..
dmxdev.c media: dvb-core: fix epoll() by calling poll_wait first 2019-02-18 14:48:37 -05:00
dvb_ca_en50221.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 113 2019-05-24 17:39:01 +02:00
dvb_demux.c treewide: Use array_size() in vmalloc() 2018-06-12 16:19:22 -07:00
dvb_frontend.c media: don't drop front-end reference count for ->detach 2019-08-04 06:33:11 -03:00
dvb_math.c
dvb_net.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 113 2019-05-24 17:39:01 +02:00
dvb_ringbuffer.c docs: Fix some broken references 2018-06-15 18:10:01 -03:00
dvb_vb2.c media updates for v4.20-rc1 2018-10-31 10:53:29 -07:00
dvbdev.c media: dvbdev: remove double-unlock 2019-03-28 14:36:14 -04:00
Kconfig Linux 5.2-rc2 2019-05-28 11:21:51 -04:00
Makefile media: dvb: fix DVB_MMAP symbol name 2018-02-23 05:20:01 -05:00