omfs: make use of kmemdup
Subsystems (2)
PATCH 1/1 omfs: make use of kmemdup
Replace call to kmalloc followed by memcpy with a direct call to kmemdup to achieve same functionality.
--- fs/omfs/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/omfs/inode.c +3 -2
@@ -363,12 +363,13 @@ static int omfs_get_imap(struct super_block *sb) bh =sb_bread (sb, block++);if (!bh) goto nomem_free; - *ptr =kmalloc (sb->s_blocksize,GFP_KERNEL ); + + *ptr =kmemdup (bh->b_data, sb->s_blocksize,GFP_KERNEL );if (!*ptr) {brelse (bh); goto nomem_free; } -memcpy (*ptr, bh->b_data, sb->s_blocksize); +if (count < sb->s_blocksize)memset ((void *)*ptr + count,0xff , sb->s_blocksize - count);
Signature · 1 line
2.20.1
Quoted 2 lines
Replace call to kmalloc followed by memcpy with a direct call to kmemdup to achieve same functionality.
I suggest to take another look at a similar patch.
fs/omfs: make use of kmemdup
https://lore.kernel.org/r/20190721112326.GA5927@hari-Inspiron-1545/
https://lore.kernel.org/patchwork/patch/1102482/
https://lkml.org/lkml/2019/7/21/40
Regards,
Markus
Quoted 6 lines · Markus Elfring
I suggest to take another look at a similar patch.
fs/omfs: make use of kmemdup
https://lore.kernel.org/r/20190721112326.GA5927@hari-Inspiron-1545/
https://lore.kernel.org/patchwork/patch/1102482/
https://lkml.org/lkml/2019/7/21/40
Oh I missed that. The patch you pointed above is of July, 2019 but I am not seeing it in v5.3 or in next-20190915.
If you know, can you point to the fs/omfs tree. It will help not to send repeated change.
-Saiyam