From mboxrd@z Thu Jan 1 00:00:00 1970 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 4B2CCC3DA7A for ; Wed, 28 Dec 2022 16:04:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234328AbiL1QEM (ORCPT ); Wed, 28 Dec 2022 11:04:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234298AbiL1QDw (ORCPT ); Wed, 28 Dec 2022 11:03:52 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09780193C0 for ; Wed, 28 Dec 2022 08:03:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9797DB81730 for ; Wed, 28 Dec 2022 16:03:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF64EC433EF; Wed, 28 Dec 2022 16:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1672243429; bh=Mi2pXkCjbXjOZG6LVa0sZCcXtxF8wOs9V4o0HoMBFMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s39b3nzTECn2/uKUmplfYBkyMb67wv8WT2eUmWUbxgHZlWceUSZ+xZTq9/6OlSrPY 9rmk8dP6pyE3ZyxHM+5l1Jk/FRqLUz9Copf45Oos5wScgGJuHYLjdSWxfQ92dhKaMF WtxLXbbNdAq4NHOq+E32w5yAORRIxbAEAYr3xXlY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yang Yingliang , Simon Horman , Kuniyuki Iwashima , "David S. Miller" , Sasha Levin Subject: [PATCH 6.0 0528/1073] af_unix: call proto_unregister() in the error path in af_unix_init() Date: Wed, 28 Dec 2022 15:35:16 +0100 Message-Id: <20221228144342.386075510@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228144328.162723588@linuxfoundation.org> References: <20221228144328.162723588@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yang Yingliang [ Upstream commit 73e341e0281a35274629e9be27eae2f9b1b492bf ] If register unix_stream_proto returns error, unix_dgram_proto needs be unregistered. Fixes: 94531cfcbe79 ("af_unix: Add unix_stream_proto for sockmap") Signed-off-by: Yang Yingliang Reviewed-by: Simon Horman Reviewed-by: Kuniyuki Iwashima Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/unix/af_unix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index d686804119c9..02fad8e8f4cd 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -3724,6 +3724,7 @@ static int __init af_unix_init(void) rc = proto_register(&unix_stream_proto, 1); if (rc != 0) { pr_crit("%s: Cannot create unix_sock SLAB cache!\n", __func__); + proto_unregister(&unix_dgram_proto); goto out; } -- 2.35.1