Skip to contentSkip to conversation

bdi: fix wrong error return value in cgwb_create()

PATCH New Tejun Heo 1 participant 1 message Jun 4, 2015

Subsystems (2)
lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 bdi: fix wrong error return value in cgwb_create()

On wb_congested_get_create() failure, cgwb_create() forgot to set @ret to -ENOMEM ending up returning 0. Fix it so that it returns -ENOMEM.

---
 mm/backing-dev.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
mm/backing-dev.c +3 -1
index 887d72a8..436bb53 100644
@@ -554,8 +554,10 @@ static int cgwb_create(struct backing_dev_info *bdi,
 		goto err_ref_exit;
 
 	wb->congested = wb_congested_get_create(bdi, blkcg_css->id, gfp);
-	if (!wb->congested)
+	if (!wb->congested) {
+		ret = -ENOMEM;
 		goto err_fprop_exit;
+	}
 
 	wb->memcg_css = memcg_css;
 	wb->blkcg_css = blkcg_css;

--
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>