[RFC 0/3] Proof of concept to fix reference counting of DVB frontends

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mauro,

Following the discussion we had today on IRC, here's a proof of concept patch
that fixes the reference counting bug in the em28xx driver with the PCTV 520E.

The problem was noticed when the tuner driver was missing. The error handling
code path tried to free the frontend by calling dvb_frontend_detach(), which
can't operate properly if the frontend refcount field hasn't been initialized
yet.

This is a proof of concept only as it doesn't patch all frontend drivers to
call the dvb_frontend_init() function. You might also want to avoid bisection
problems, and possibly bikeshed function names. You could also add a Fixes tag
somewhere referencing

	commit 1f862a68df2449bc7b1cf78dce616891697b4bdf
	Author: Max Kellermann <max.kellermann@xxxxxxxxx>
	Date:   Tue Aug 9 18:32:51 2016 -0300

	    [media] dvb_frontend: move kref to struct dvb_frontend

although I think the problem preexisted that commit under another form.

Laurent Pinchart (3):
  dvb_frontend: Rename the dvb_frontend_init() function
  dvb_frontend: Add dvb_frontend_init() function
  media: drxk: Initialize the frontend after allocating it

 drivers/media/dvb-core/dvb_frontend.c   | 50 ++++++++++++++++++++-------------
 drivers/media/dvb-core/dvb_frontend.h   | 11 ++++++++
 drivers/media/dvb-frontends/drxk_hard.c |  5 ++++
 3 files changed, 46 insertions(+), 20 deletions(-)

-- 
Regards,

Laurent Pinchart




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux