lkml.org 
[lkml]   [2021]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] erofs: fix double free of 'copied'
From
Date
On 2021/8/25 20:07, Gao Xiang wrote:
> Dan reported a new smatch warning [1]
> "fs/erofs/inode.c:210 erofs_read_inode() error: double free of 'copied'"
>
> Due to new chunk-based format handling logic, the error path can be
> called after kfree(copied).
>
> Set "copied = NULL" after kfree(copied) to fix this.
>
> [1] https://lore.kernel.org/r/202108251030.bELQozR7-lkp@intel.com
> Fixes: c5aa903a59db ("erofs: support reading chunk-based uncompressed files")
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

\
 
 \ /
  Last update: 2021-08-25 14:17    [W:0.024 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site