linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] drivers/media/dvb-core/en50221: move code to dvb_ca_private_free()
@ 2016-03-21 13:30 Max Kellermann
  2016-03-21 13:30 ` [PATCH 2/6] drivers/media/dvb-core/en50221: postpone release until file is closed Max Kellermann
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Max Kellermann @ 2016-03-21 13:30 UTC (permalink / raw)
  To: linux-kernel, linux-media

Prepare for postponing the call until all file handles have been
closed.

Signed-off-by: Max Kellermann <max@duempel.org>
---
 drivers/media/dvb-core/dvb_ca_en50221.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index f82cd1f..e33364c 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -161,6 +161,17 @@ struct dvb_ca_private {
 	struct mutex ioctl_mutex;
 };
 
+static void dvb_ca_private_free(struct dvb_ca_private *ca)
+{
+	dvb_unregister_device(ca->dvbdev);
+	unsigned int i;
+	for (i = 0; i < ca->slot_count; i++) {
+		vfree(ca->slot_info[i].rx_buffer.data);
+	}
+	kfree(ca->slot_info);
+	kfree(ca);
+}
+
 static void dvb_ca_en50221_thread_wakeup(struct dvb_ca_private *ca);
 static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * ebuf, int ecount);
 static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * ebuf, int ecount);
@@ -1759,10 +1770,7 @@ void dvb_ca_en50221_release(struct dvb_ca_en50221 *pubca)
 
 	for (i = 0; i < ca->slot_count; i++) {
 		dvb_ca_en50221_slot_shutdown(ca, i);
-		vfree(ca->slot_info[i].rx_buffer.data);
 	}
-	kfree(ca->slot_info);
-	dvb_unregister_device(ca->dvbdev);
-	kfree(ca);
+	dvb_ca_private_free(ca);
 	pubca->private = NULL;
 }

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-06-09 11:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21 13:30 [PATCH 1/6] drivers/media/dvb-core/en50221: move code to dvb_ca_private_free() Max Kellermann
2016-03-21 13:30 ` [PATCH 2/6] drivers/media/dvb-core/en50221: postpone release until file is closed Max Kellermann
2016-06-09  9:38   ` Mauro Carvalho Chehab
2016-03-21 13:30 ` [PATCH 3/6] drivers/media/media-devnode: clear private_data before put_device() Max Kellermann
2016-03-21 13:30 ` [PATCH 4/6] drivers/media/media-device: move debug log before _devnode_unregister() Max Kellermann
2016-03-21 13:30 ` [PATCH 5/6] drivers/media/media-device: add "release" callback Max Kellermann
2016-06-09 11:56   ` Mauro Carvalho Chehab
2016-03-21 13:30 ` [PATCH 6/6] drivers/media/dvb-usb-dvb: postpone kfree(mdev) Max Kellermann
2016-03-21 13:45   ` kbuild test robot
2016-03-21 13:56   ` kbuild test robot
2016-03-21 13:55 ` [PATCH 1/6] drivers/media/dvb-core/en50221: move code to dvb_ca_private_free() kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).