aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2011-04-24 13:48:17 -0700
committerH. Peter Anvin <hpa@zytor.com>2011-04-24 13:48:17 -0700
commit303bd1a3e1c8642934d40914880a42ae98610599 (patch)
tree7b6da52ff46989be67dad759ee0338667dcde88a
parent727ce291cc82b2634a188ebfc059eb4fee2583c8 (diff)
downloadsyslinux-303bd1a3e1c8642934d40914880a42ae98610599.tar.gz
syslinux-303bd1a3e1c8642934d40914880a42ae98610599.tar.xz
syslinux-303bd1a3e1c8642934d40914880a42ae98610599.zip
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@zytor.com>
-rw-r--r--core/fs/pxe/tcp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fs/pxe/tcp.c b/core/fs/pxe/tcp.c
index 109f803d..759ec9f3 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)