librdmacm: Fix resource leak in error flow
PATCH 1/2 librdmacm: Fix resource leak in error flow
Prevent resource leak by destroying the event channel before returning from function in an error flow.
---
src/cma.c +4 -1
@@ -2122,8 +2122,11 @@ int rdma_migrate_id(struct rdma_cm_id *id, struct rdma_event_channel *channel) cmd->fd = id->channel->fd; ret =write (channel->fd, msg, size); -if (ret != size) +if (ret != size) { +if (sync) +rdma_destroy_event_channel (channel);return (ret >=0 ) ?ERR (ENODATA ) :-1 ; + }VALGRIND_MAKE_MEM_DEFINED (resp,sizeof *resp);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CALvMawrEYfJGj4uT5rU-ov9hLRnyi=AumhW3btv4GxsjE5fkrQ@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): CALvMawrEYfJGj4uT5rU-ov9hLRnyi=AumhW3btv4GxsjE5fkrQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 1 line
Did you have a chance for reviewing those patches?
I did see and flagged them for follow up, but I have not reviewed them yet. I should get to them sometime this week. --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html