virtio: Correct dir creation to use existing stream
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user