ramfs: fix broken write size set
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
72cca62821
commit
d64ed97227
1 changed files with 6 additions and 6 deletions
|
|
@ -113,14 +113,14 @@ static ssize_t write(inode_t *inode, char *buf, size_t size, size_t offset)
|
|||
ssize_t ret = 0;
|
||||
if (!inode->data) {
|
||||
inode->data = kalloc(size + offset, ALLOC_KERN);
|
||||
}
|
||||
|
||||
if (!inode->data) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
if (!inode->data) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
inode->file_size = size + offset;
|
||||
inode->file_size = size + offset;
|
||||
}
|
||||
|
||||
if (inode->file_size < size + offset) {
|
||||
inode->data = krealloc(inode->data, size + offset, ALLOC_KERN);
|
||||
|
|
|
|||
Loading…
Reference in a new issue