pxe: tcp: always call the close method
authorH. Peter Anvin <hpa@zytor.com>
Sun, 24 Apr 2011 19:44:31 +0000 (12:44 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 24 Apr 2011 19:46:07 +0000 (12:46 -0700)
Always call the designated close method, instead of assuming it is
tcp_close_file().  This isn't the case for FTP, which also needs to
manage the control connection.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/fs/pxe/tcp.c

index af0cffc..109f803 100644 (file)
@@ -24,6 +24,7 @@
 void tcp_close_file(struct inode *inode)
 {
     struct pxe_pvt_inode *socket = PVT(inode);
+
     if (socket->buf) {
        netbuf_delete(socket->buf);
         socket->buf = NULL;
@@ -55,7 +56,7 @@ void tcp_fill_buffer(struct inode *inode)
            socket->tftp_goteof = 1;
            if (inode->size == -1)
                inode->size = socket->tftp_filepos;
-           tcp_close_file(inode);
+           socket->close(inode);
            return;
        }
     }