writeback: Avoid uninitialized variable warning
Jan Kara
reviewerPATCH 1/1 writeback: Avoid uninitialized variable warning
Smatch reports that 'new_wb' in cleanup_offline_cgwb() can be used uninitialized. This is actually not true as root cgroup never gets offlined and other cgroups have a parent but still it's reasonable defensive programming to have new_wb initialized to NULL.
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Jan Kara <[email protected]>
--- fs/fs-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Christian, please either merge this patch or fold it into 67c312b4e9bf ("writeback: Avoid contention on wb->list_lock when switching inodes") in your tree. Thanks!
fs/fs-writeback.c +1 -1
@@ -709,7 +709,7 @@ bool cleanup_offline_cgwb(struct bdi_writeback *wb) {struct cgroup_subsys_state *memcg_css;struct inode_switch_wbs_context *isw; -struct bdi_writeback *new_wb; +struct bdi_writeback *new_wb =NULL ;int nr;bool restart = false;
Signature · 1 line
2.51.0