diff --git a/fs/hmdfs/comm/socket_adapter.c b/fs/hmdfs/comm/socket_adapter.c index 7005303e3735b455e348cdc08e481b39a7bb0a24..0404c2a79d3abb10b8130fbceb92fe3a5d2982b6 100644 --- a/fs/hmdfs/comm/socket_adapter.c +++ b/fs/hmdfs/comm/socket_adapter.c @@ -439,13 +439,13 @@ int hmdfs_sendmessage_request(struct hmdfs_peer *con, msg_wq = kzalloc(sizeof(*msg_wq), GFP_KERNEL); if (!msg_wq) { ret = -ENOMEM; - goto free; + goto free_filp; } ret = msg_init(con, msg_wq); if (ret) { kfree(msg_wq); msg_wq = NULL; - goto free; + goto free_filp; } dec = true; head->msg_id = cpu_to_le32(msg_wq->head.msg_id); @@ -513,6 +513,7 @@ int hmdfs_sendmessage_request(struct hmdfs_peer *con, free_filp: if (sm->local_filp) fput(sm->local_filp); + kfree(head); return ret; }