Skip to contentSkip to conversation

writeback: implement memcg wb_domain

DISCUSSION Dan Carpenter 2 participants 2 messages Jun 4, 2015 Memory management

lore
Share & tools
lore
#0 lore raw

Hello Tejun Heo,

The patch 841710aa6e4a: "writeback: implement memcg wb_domain" from May 22, 2015, leads to the following static checker warning:

	mm/backing-dev.c:558 cgwb_create()
	warn: missing error code here? 'wb_congested_get_create()' failed. 'ret' = '0'

mm/backing-dev.c
548 ret = percpu_ref_init(&wb->refcnt, cgwb_release, 0, gfp);
549 if (ret)
550 goto err_wb_exit;
551
552 ret = fprop_local_init_percpu(&wb->memcg_completions, gfp);
553 if (ret)
554 goto err_ref_exit;
555
556 wb->congested = wb_congested_get_create(bdi, blkcg_css->id, gfp);
557 if (!wb->congested)

   558                  goto err_fprop_exit;
                        ^^^^^^^^^^^^^^^^^^^

Did you want to set ret = -ENOMEM here?

559

regards,
dan carpenter

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 21 lines · Dan Carpenter

Hello Tejun Heo,

The patch 841710aa6e4a: "writeback: implement memcg wb_domain" from May 22, 2015, leads to the following static checker warning:

	mm/backing-dev.c:558 cgwb_create()
	warn: missing error code here? 'wb_congested_get_create()' failed. 'ret' = '0'

mm/backing-dev.c

   548          ret = percpu_ref_init(&wb->refcnt, cgwb_release, 0, gfp);
   549          if (ret)
   550                  goto err_wb_exit;
   551  
   552          ret = fprop_local_init_percpu(&wb->memcg_completions, gfp);
   553          if (ret)
   554                  goto err_ref_exit;
   555  
   556          wb->congested = wb_congested_get_create(bdi, blkcg_css->id, gfp);
   557          if (!wb->congested)
   558                  goto err_fprop_exit;
                        ^^^^^^^^^^^^^^^^^^^
Quoted 1 line

Did you want to set ret = -ENOMEM here?

Yes, definitely. Thank you very much for spotting it. Will send a fix patch soon.

Signature · 7 lines
tejun

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>