All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] frame-xchg: Drop l_io read destroy handler
  2020-03-20 16:20 [PATCH] frame-xchg: Drop l_io read destroy handler Andrew Zaborowski
@ 2020-03-20 15:48 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2020-03-20 15:48 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

Hi Andrew,

On 3/20/20 11:20 AM, Andrew Zaborowski wrote:
> This function was intended to catch socket errors and destroy the group
> but it would leak the l_io object if that happened, and if called on
> ordinary shutdown it could cause a crash.  Since we're now assuming
> that the netlink socket operations never fail just remove it.
> ---
>   src/frame-xchg.c | 15 +--------------
>   1 file changed, 1 insertion(+), 14 deletions(-)
> 

Applied, thanks.

Regards,
-Denis

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

* [PATCH] frame-xchg: Drop l_io read destroy handler
@ 2020-03-20 16:20 Andrew Zaborowski
  2020-03-20 15:48 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Zaborowski @ 2020-03-20 16:20 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

This function was intended to catch socket errors and destroy the group
but it would leak the l_io object if that happened, and if called on
ordinary shutdown it could cause a crash.  Since we're now assuming
that the netlink socket operations never fail just remove it.
---
 src/frame-xchg.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/src/frame-xchg.c b/src/frame-xchg.c
index 131d5061..50351615 100644
--- a/src/frame-xchg.c
+++ b/src/frame-xchg.c
@@ -361,19 +361,6 @@ static bool frame_watch_group_io_read(struct l_io *io, void *user_data)
 	return true;
 }
 
-static void frame_watch_group_io_destroy(void *user_data)
-{
-	struct watch_group *group = user_data;
-
-	group->io = NULL;
-
-	if (l_queue_remove(watch_groups, group)) {
-		l_error("Frame watch group socket closed");
-
-		frame_watch_group_destroy(group);
-	}
-}
-
 static struct watch_group *frame_watch_group_new(uint64_t wdev_id, uint32_t id)
 {
 	struct watch_group *group = l_new(struct watch_group, 1);
@@ -435,7 +422,7 @@ static struct watch_group *frame_watch_group_new(uint64_t wdev_id, uint32_t id)
 
 	l_io_set_close_on_destroy(group->io, true);
 	l_io_set_read_handler(group->io, frame_watch_group_io_read, group,
-				frame_watch_group_io_destroy);
+				NULL);
 	group->write_queue = l_queue_new();
 
 	return group;
-- 
2.20.1

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

end of thread, other threads:[~2020-03-20 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20 16:20 [PATCH] frame-xchg: Drop l_io read destroy handler Andrew Zaborowski
2020-03-20 15:48 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.