[openib-general] [PATCH] core: fix user_mad memory leaks on timeout
Michael S. Tsirkin
mst at mellanox.co.il
Thu Dec 8 05:51:16 PST 2005
Dont leak packet if it had a timeout.
Dont leak timeout mad if queue_packet fails.
Signed-off-by: Jack Morgenstein <jackm at mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>
Index: openib/drivers/infiniband/core/user_mad.c
===================================================================
--- openib.orig/drivers/infiniband/core/user_mad.c 2005-12-08 15:40:41.000000000 +0200
+++ openib/drivers/infiniband/core/user_mad.c 2005-12-08 15:40:28.000000000 +0200
@@ -197,8 +197,8 @@ static void send_handler(struct ib_mad_a
memcpy(timeout->mad.data, packet->mad.data,
sizeof (struct ib_mad_hdr));
- if (!queue_packet(file, agent, timeout))
- return;
+ if (queue_packet(file, agent, timeout))
+ kfree(timeout);
}
out:
kfree(packet);
--
MST
More information about the general
mailing list