Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3F00C4332F for ; Tue, 18 Oct 2022 19:12:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbiJRTM5 (ORCPT ); Tue, 18 Oct 2022 15:12:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbiJRTMb (ORCPT ); Tue, 18 Oct 2022 15:12:31 -0400 Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83AC33470A for ; Tue, 18 Oct 2022 12:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1666120330; x=1697656330; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ubNlopTIwxKxBncLsiU7kSAU5X2S9g4tz2PG67CbMaA=; b=MVyFm2m4LcsIHnJcdr8BKJ0YIvdEUcWwgw3MSEFHqlZhmnzgyP6DE+Hs l84TvdSDPESh+vxXFaF36EwhytwkNKEAQ4+RuaKFclS+YQTmr0d2XHbIU eyTkzVgaM3pWUnj+dwr/NH/5pSGwM8+HRE/NU+QxkwJK04Iaopywog8xa c=; X-IronPort-AV: E=Sophos;i="5.95,194,1661817600"; d="scan'208";a="141516057" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-iad-1e-54c9d11f.us-east-1.amazon.com) ([10.25.36.210]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 19:12:08 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1e-54c9d11f.us-east-1.amazon.com (Postfix) with ESMTPS id 3983EC0FD6; Tue, 18 Oct 2022 19:12:04 +0000 (UTC) Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 18 Oct 2022 19:12:04 +0000 Received: from 88665a182662.ant.amazon.com (10.43.160.214) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.15; Tue, 18 Oct 2022 19:12:02 +0000 From: Kuniyuki Iwashima To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Hideaki YOSHIFUJI CC: Kuniyuki Iwashima , Kuniyuki Iwashima , Subject: [PATCH v1 net-next 5/5] inet6: Clean up failure path in do_ipv6_setsockopt(). Date: Tue, 18 Oct 2022 12:09:56 -0700 Message-ID: <20221018190956.1308-6-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221018190956.1308-1-kuniyu@amazon.com> References: <20221018190956.1308-1-kuniyu@amazon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.43.160.214] X-ClientProxiedBy: EX13D10UWB004.ant.amazon.com (10.43.161.121) To EX19D004ANA001.ant.amazon.com (10.37.240.138) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We can reuse the unlock label above and need not repeat the same code. Signed-off-by: Kuniyuki Iwashima --- net/ipv6/ipv6_sockglue.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 532f4478c884..9ce51680290b 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -1005,10 +1005,8 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname, return retv; e_inval: - sockopt_release_sock(sk); - if (needs_rtnl) - rtnl_unlock(); - return -EINVAL; + retv = -EINVAL; + goto unlock; } int ipv6_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval, -- 2.30.2