瀏覽代碼

totemiba: free send_buf on ibv_reg_mr failure

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
(cherry picked from commit 57749ec02a081b21218508355f139315bb95b652)
Jan Friesse 14 年之前
父節點
當前提交
4d36390a5c
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      exec/totemiba.c

+ 2 - 0
exec/totemiba.c

@@ -271,6 +271,7 @@ static inline struct send_buf *mcast_send_buf_get (
 		2048, IBV_ACCESS_LOCAL_WRITE);
 	if (send_buf->mr == NULL) {
 		log_printf (LOGSYS_LEVEL_ERROR, "couldn't register memory range\n");
+		free (send_buf);
 		return (NULL);
 	}
 	list_init (&send_buf->list_all);
@@ -307,6 +308,7 @@ static inline struct send_buf *token_send_buf_get (
 		2048, IBV_ACCESS_LOCAL_WRITE);
 	if (send_buf->mr == NULL) {
 		log_printf (LOGSYS_LEVEL_ERROR, "couldn't register memory range\n");
+		free (send_buf);
 		return (NULL);
 	}
 	list_init (&send_buf->list_all);