diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-07 04:01:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-07 04:01:47 +0200 |
commit | 053f78d359953be40043972c98e16b3f1cd9fc27 (patch) | |
tree | 80185e1554da6362dd3ca411a3e724864c59dc05 /fs/udf/file.c | |
parent | Merge tag 'extcon-fixes-for-4.6-rc3' of git://git.kernel.org/pub/scm/linux/ke... (diff) | |
parent | lkdtm: do not leak free page on kmalloc failure (diff) | |
download | linux-053f78d359953be40043972c98e16b3f1cd9fc27.tar.xz linux-053f78d359953be40043972c98e16b3f1cd9fc27.zip |
Merge tag 'lkdtm-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into char-misc-linus
Kees briefly writes:
fixes some possible memory allocation leaks on error paths
Diffstat (limited to 'fs/udf/file.c')
-rw-r--r-- | fs/udf/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c index 1af98963d860..877ba1c9b461 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c @@ -46,7 +46,7 @@ static void __udf_adinicb_readpage(struct page *page) kaddr = kmap(page); memcpy(kaddr, iinfo->i_ext.i_data + iinfo->i_lenEAttr, inode->i_size); - memset(kaddr + inode->i_size, 0, PAGE_CACHE_SIZE - inode->i_size); + memset(kaddr + inode->i_size, 0, PAGE_SIZE - inode->i_size); flush_dcache_page(page); SetPageUptodate(page); kunmap(page); @@ -87,14 +87,14 @@ static int udf_adinicb_write_begin(struct file *file, { struct page *page; - if (WARN_ON_ONCE(pos >= PAGE_CACHE_SIZE)) + if (WARN_ON_ONCE(pos >= PAGE_SIZE)) return -EIO; page = grab_cache_page_write_begin(mapping, 0, flags); if (!page) return -ENOMEM; *pagep = page; - if (!PageUptodate(page) && len != PAGE_CACHE_SIZE) + if (!PageUptodate(page) && len != PAGE_SIZE) __udf_adinicb_readpage(page); return 0; } |