[syslinux:elflink] pxe: Handle closing file with NULL ->inode

syslinux-bot for Matt Fleming matt.fleming at intel.com
Wed Mar 6 09:42:06 PST 2013


Commit-ID:  c87df9b16191023498c2780e47527cfee3ddf015
Gitweb:     http://www.syslinux.org/commit/c87df9b16191023498c2780e47527cfee3ddf015
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Mon, 18 Feb 2013 20:25:27 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 26 Feb 2013 11:29:09 +0000

pxe: Handle closing file with NULL ->inode

It's possible that pxe_close_file() will be called with a NULL
file->inode from searchdir() if pxe_searchdir() fails to lookup a
file.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 core/fs/pxe/pxe.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index 5278751..ff8a0b3 100644
--- a/core/fs/pxe/pxe.c
+++ b/core/fs/pxe/pxe.c
@@ -74,6 +74,9 @@ static void pxe_close_file(struct file *file)
     struct inode *inode = file->inode;
     struct pxe_pvt_inode *socket = PVT(inode);
 
+    if (!inode)
+	return;
+
     if (!socket->tftp_goteof) {
 	socket->ops->close(inode);
     }


More information about the Syslinux-commits mailing list