[syslinux:lwip] pxe: tcp: close the connection before freeing the buffers

syslinux-bot for H. Peter Anvin hpa at zytor.com
Sun Apr 24 21:03:23 PDT 2011


Commit-ID:  303bd1a3e1c8642934d40914880a42ae98610599
Gitweb:     http://syslinux.zytor.com/commit/303bd1a3e1c8642934d40914880a42ae98610599
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Sun, 24 Apr 2011 13:48:17 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Sun, 24 Apr 2011 13:48:17 -0700

pxe: tcp: close the connection before freeing the buffers

As long as the connection is opened, we may end up receiving data, so
don't free the receive buffers until after the connection is closed.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 core/fs/pxe/tcp.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/fs/pxe/tcp.c b/core/fs/pxe/tcp.c
index 109f803..759ec9f 100644
--- a/core/fs/pxe/tcp.c
+++ b/core/fs/pxe/tcp.c
@@ -25,14 +25,14 @@ void tcp_close_file(struct inode *inode)
 {
     struct pxe_pvt_inode *socket = PVT(inode);
 
-    if (socket->buf) {
-	netbuf_delete(socket->buf);
-        socket->buf = NULL;
-    }
     if (socket->conn) {
 	netconn_delete(socket->conn);
 	socket->conn = NULL;
     }
+    if (socket->buf) {
+	netbuf_delete(socket->buf);
+        socket->buf = NULL;
+    }
 }
 
 void tcp_fill_buffer(struct inode *inode)



More information about the Syslinux-commits mailing list