From patchwork Wed Nov 1 08:41:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 160468 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp267523vqx; Wed, 1 Nov 2023 01:41:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsN2iZDKFPnf2/KbKYya6wfMm/ZGkw5BgTPvhKjlOu93xjHShdjzsc9CUmanu+qKxslnAZ X-Received: by 2002:a05:6300:8002:b0:181:219f:4a66 with SMTP id an2-20020a056300800200b00181219f4a66mr3093557pzc.34.1698828111158; Wed, 01 Nov 2023 01:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698828111; cv=none; d=google.com; s=arc-20160816; b=VgQOoV7cXq4qEcfZvwNkp609CxrF9U8Wqjn9vuI9jYVYbxseW4oSIw96Xy79LJ3d9o x0QJ4SRszsT2lX+cswwEN88kJBrmtBuPiwJlZcKC4aapwgTAbaETKCopHD8T1vEi6ah1 F/wSGWhkQYv2u2uwG/VXJf99luPh6cI+nMU2i/Vnr3xMKok6Ay/lRrPyml+V+B9d1i5T S1BR55A6m9wldNidJAMcDdwgm31hYyEml8PDYfUSnHsaJsmAKT2VEU9sZ7YsLAo/S2Y8 XZKl0zsZz2bibjJAwsPw+Vh6cQuGC2n4FDiOPBl2KNJCK0/wzL1W/go2I6FumRdJ4YPm Nf5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=CVxqb6cWWdS66o3gepO0aplabS1ELEsS85NcWREXcuY=; fh=x8vrGcRLQfXUHWj+UvaBsqOtV6bb1MAfabwaS/FgFhI=; b=eWEsttnaJPiv14lrBn5Zo8Y1imk9GgbnYLxjs+az9eG2ekRfurutjYFxInacRe5Kz9 +zV+6t+gBURkzu8tm6smNN8oYIUjX6DQU4tFHWkT9MGRTChdz3GccJCSAlXHUIFHeGQF FfWk/oFSoFnnsf0xVSoygCTVHOpsGyWJ1pD7vo7IRTTUrzwndc7GhuWMFrbBphdd/Biw ph2ZqW45yTXP/sZByGV8LBmqGWyu2DtQi/U/u8q29hGeVlUBJSYiPDsI0B/pDqms45lm w4Xinj9K90DGwMLWzNfCpWLqvB3pV4w7D7HoWYblHXjroKtnwlKDPpAMs9zgL+7fzpL7 9jbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id lp5-20020a17090b4a8500b0027408bd8420si393991pjb.13.2023.11.01.01.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 01:41:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 250EE805C3C6; Wed, 1 Nov 2023 01:41:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232235AbjKAIl1 (ORCPT + 35 others); Wed, 1 Nov 2023 04:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232163AbjKAIl0 (ORCPT ); Wed, 1 Nov 2023 04:41:26 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id BF470103 for ; Wed, 1 Nov 2023 01:41:23 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 600026059607D; Wed, 1 Nov 2023 16:41:20 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: brauner@kernel.org, viro@zeniv.linux.org.uk, dwindsor@gmail.com, keescook@chromium.org, elena.reshetova@intel.com Cc: linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] =?utf-8?q?nsproxy=3A_Remove_unnecessary_=E2=80=980=E2=80=99?= =?utf-8?q?_values_from_ret?= Date: Wed, 1 Nov 2023 16:41:18 +0800 Message-Id: <20231101084118.6954-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 01:41:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781350385208690113 X-GMAIL-MSGID: 1781350385208690113 The ret variable can be defined without assigning a value, as it is assigned before use. Signed-off-by: Li kunyu --- kernel/nsproxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c index 15781acaac1ce..b7e398d954b09 100644 --- a/kernel/nsproxy.c +++ b/kernel/nsproxy.c @@ -374,12 +374,12 @@ static inline int validate_ns(struct nsset *nsset, struct ns_common *ns) */ static int validate_nsset(struct nsset *nsset, struct pid *pid) { - int ret = 0; unsigned flags = nsset->flags; struct user_namespace *user_ns = NULL; struct pid_namespace *pid_ns = NULL; struct nsproxy *nsp; struct task_struct *tsk; + int ret; /* Take a "snapshot" of the target task's namespaces. */ rcu_read_lock();