aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-02-18 20:25:27 +0000
committerMatt Fleming <matt.fleming@intel.com>2013-02-26 11:29:09 +0000
commitc87df9b16191023498c2780e47527cfee3ddf015 (patch)
tree21f8a59e82184fd866c9d7963f99da2a61e72f10
parent76da2ae050d72a31fd47c2fb53f7081781de62ff (diff)
downloadsyslinux-c87df9b16191023498c2780e47527cfee3ddf015.tar.gz
syslinux-c87df9b16191023498c2780e47527cfee3ddf015.tar.xz
syslinux-c87df9b16191023498c2780e47527cfee3ddf015.zip
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@intel.com>
-rw-r--r--core/fs/pxe/pxe.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index 52787514..ff8a0b33 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);
}