lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20150604212051.GV20091@mtj.duckdns.org>
Date:	Fri, 5 Jun 2015 06:20:51 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Jens Axboe <axboe@...nel.dk>
Cc:	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	Dan Carpenter <dan.carpenter@...cle.com>
Subject: [PATCH block/for-4.2/writeback] 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.

Signed-off-by: Tejun Heo <tj@...nel.org>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
---
 mm/backing-dev.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 887d72a8..436bb53 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ