
From: Simon Glass <sjg@chromium.org> Rather than creating a new stream, which gets lost, virtio_fs_dir_open() should use the existing one. Fix it, so that the fh member is preserved for future use. This fixes a problem where the fh value is not preserved, thus causing a subsequent 'ls' on the same directory to fail. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: #15 --- drivers/virtio/fs_dir.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/virtio/fs_dir.c b/drivers/virtio/fs_dir.c index 72ab9a087a8..4ca320175c5 100644 --- a/drivers/virtio/fs_dir.c +++ b/drivers/virtio/fs_dir.c @@ -25,10 +25,6 @@ static int virtio_fs_dir_open(struct udevice *dev, struct fs_dir_stream *strm) struct udevice *fs = dev_get_parent(dev); int ret; - strm = malloc(sizeof(struct fs_dir_stream)); - if (!strm) - return log_msg_ret("vso", -ENOMEM); - log_debug("opening inode %lld\n", dir_priv->inode); ret = virtio_fs_opendir(fs, dir_priv->inode, &strm->fh); log_debug("2 open ret %d strm %p fh %llx\n", ret, strm, strm->fh); -- 2.43.0 base-commit: 41d10e0f8b88ed7fabd6c95cc129bf52fed080a7 branch: virt