summaryrefslogtreecommitdiff
path: root/sys/boot
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2002-03-30 01:36:03 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2002-03-30 01:36:03 +0000
commitc61a2c84f05e009b4d12e77d6234fe6ad7d7bd32 (patch)
tree3d55502a4e099d5c659ad9af74b377655cb65d2f /sys/boot
parentd98975ba901602f5fd2afea3399a8412b6fd3e5e (diff)
Notes
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/efi/libefi/efifs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/boot/efi/libefi/efifs.c b/sys/boot/efi/libefi/efifs.c
index e4598810d37c..767ce647b39f 100644
--- a/sys/boot/efi/libefi/efifs.c
+++ b/sys/boot/efi/libefi/efifs.c
@@ -48,7 +48,12 @@ efifs_open(const char *upath, struct open_file *f)
CHAR16 *cp;
CHAR16 *path;
- if (!dev->d_handle)
+ /*
+ * We cannot blindly assume that f->f_devdata points to a
+ * efi_devdesc structure. Before we dereference 'dev', make
+ * sure that the underlying device is ours.
+ */
+ if (f->f_dev != &efifs_dev || dev->d_handle == NULL)
return ENOENT;
status = BS->HandleProtocol(dev->d_handle, &sfsid, (VOID **)&sfs);