From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756544AbcBVXHo (ORCPT ); Mon, 22 Feb 2016 18:07:44 -0500 Received: from mail-qg0-f46.google.com ([209.85.192.46]:33265 "EHLO mail-qg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756106AbcBVXFz (ORCPT ); Mon, 22 Feb 2016 18:05:55 -0500 From: Tejun Heo To: lizefan@huawei.com, hannes@cmpxchg.org Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Tejun Heo Subject: [PATCH 1/6] cgroup: fix error return value of cgroup_addrm_files() Date: Mon, 22 Feb 2016 18:05:44 -0500 Message-Id: <1456182349-18156-2-git-send-email-tj@kernel.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456182349-18156-1-git-send-email-tj@kernel.org> References: <1456182349-18156-1-git-send-email-tj@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cgroup_addrm_files() incorrectly returned 0 after add failure. Fix it. Signed-off-by: Tejun Heo --- kernel/cgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 7ad6191..68b032d 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -3369,7 +3369,7 @@ static int cgroup_addrm_files(struct cgroup_subsys_state *css, bool is_add) { struct cftype *cft, *cft_end = NULL; - int ret; + int ret = 0; lockdep_assert_held(&cgroup_mutex); @@ -3398,7 +3398,7 @@ static int cgroup_addrm_files(struct cgroup_subsys_state *css, cgroup_rm_file(cgrp, cft); } } - return 0; + return ret; } static int cgroup_apply_cftypes(struct cftype *cfts, bool is_add) -- 2.5.0