From patchwork Tue Nov 15 09:24:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Zhongjin X-Patchwork-Id: 20264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2612572wru; Tue, 15 Nov 2022 01:36:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf5wnvqWMcL/sXRnJ29bJtWHOxG8uiyaXeFZ0eS7o40lXzaW7n+KTObAocQZwk7un4yHvIRw X-Received: by 2002:a17:90a:bd95:b0:213:5d6:8280 with SMTP id z21-20020a17090abd9500b0021305d68280mr1280529pjr.185.1668505004587; Tue, 15 Nov 2022 01:36:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668505004; cv=none; d=google.com; s=arc-20160816; b=NC4beCpser/oOAWnJaGgztpfe1xVCDveFfzzbCeo3+2QaQrXvslBetRmQWwLyPy4AN yfbMBnxAHR4Mpmxt3S0sM3nQA6JX6ITVd28PDBY2RH6t+MVrwPx9qtKCCqliwBxderIp OKlwGADxxZaXnCnJ5omXWQXG6tsPuhJefhvIncCQt7XnjZPCK18zaTUJ+66Rz948IdhJ D8nlPjjx3ofPPHws0JLOM8lY/NjCLvw1hgauzCqYQyV+kJmxZv+kdtIJxcpBfqnscxXo C873VPBkqLm2f+BRKiumWwi8Qxzt4WxcDGPRHUMYOCmY6EW7xcLJkxRl70uid1aZyNLn 9oug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=BQuppwOvmwmJsP0ql5/VzDdJyyXzPLOqEFigO+MeyH0=; b=eMWSEnMDgqmoxRpxrncLnqCjXYXsqDVI5V0/mo67ya/io95h13x7zEkVwtxQZW+4bJ ReooQnEQvOZ8XCGGigDELkzp8P4OtzIwID3tZxWUqzWj3PZKSrjqLnmV4gdGIIqPSVHx ytShiddVqvoZlj1IgZ5Kjx88SzuDLuuxXqF2N7Q/hLfWFEQ4z8qnLnAXXe7qK6AZifca WSmD/xdy35/WoRgOPit0NAYrcbzXPDYCIrlZSYKRkIdNzqJFtOTm5A69+yFLqLvrMEsl XUAyazjkWwr/Y9r8/jVd+jSA41ILHmWbLHd3RBjzkZs0M1xnqhoNum9f2DTgWqz6Hw81 6ySg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pq10-20020a17090b3d8a00b00213120e0c85si16207669pjb.156.2022.11.15.01.36.31; Tue, 15 Nov 2022 01:36:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236993AbiKOJ2K (ORCPT + 99 others); Tue, 15 Nov 2022 04:28:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbiKOJ2I (ORCPT ); Tue, 15 Nov 2022 04:28:08 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E807D2F1; Tue, 15 Nov 2022 01:28:07 -0800 (PST) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NBLS733N1zHvtM; Tue, 15 Nov 2022 17:27:35 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 15 Nov 2022 17:27:51 +0800 Received: from ubuntu1804.huawei.com (10.67.175.36) by dggpemm500013.china.huawei.com (7.185.36.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 15 Nov 2022 17:27:51 +0800 From: Chen Zhongjin To: , CC: , , , , , , , Subject: [PATCH] scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails Date: Tue, 15 Nov 2022 17:24:42 +0800 Message-ID: <20221115092442.133088-1-chenzhongjin@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.175.36] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500013.china.huawei.com (7.185.36.172) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749554304021124794?= X-GMAIL-MSGID: =?utf-8?q?1749554304021124794?= fcoe_init() calls fcoe_transport_attach(&fcoe_sw_transport), but when fcoe_if_init() fails, &fcoe_sw_transport is not detached and leave freed &fcoe_sw_transport on list fcoe_transports, which causes panic when reinserting module. BUG: unable to handle page fault for address: fffffbfff82e2213 RIP: 0010:fcoe_transport_attach+0xe1/0x230 [libfcoe] Call Trace: do_one_initcall+0xd0/0x4e0 load_module+0x5eee/0x7210 ... Fixes: 78a582463c1e ("[SCSI] fcoe: convert fcoe.ko to become an fcoe transport provider driver") Signed-off-by: Chen Zhongjin --- drivers/scsi/fcoe/fcoe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 6ec296321ffc..38774a272e62 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -2491,6 +2491,7 @@ static int __init fcoe_init(void) out_free: mutex_unlock(&fcoe_config_mutex); + fcoe_transport_detach(&fcoe_sw_transport); out_destroy: destroy_workqueue(fcoe_wq); return rc;