Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4883433pjb; Mon, 27 Jul 2020 07:32:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUj1QZcwCQHZbcHMw6flZAvuOZPWum1wJlhnbmA0tWy4mRSdFKUxyJZlbwqxAi0O6tCbBs X-Received: by 2002:a05:6402:1457:: with SMTP id d23mr9721054edx.149.1595860360541; Mon, 27 Jul 2020 07:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860360; cv=none; d=google.com; s=arc-20160816; b=DZmYZypP/vtBVeqYvau/SfJRfufZ+Yr0gXhoyDJopr1zA7Bqfrtv6sn7iiFibdCVjx Elz5ERFFJIBpT9n/OjfLyIR1EuLLaOF23Ork7LO1IzdtRFlaqP/5eYPgM/BllFHWRfYc Ft9nmpK+qIN7B9Xw0N0BdHBshsoxOFoBfT3C+kUJIg7FqzpkcaMPhbD3aZOYG+EKU2j7 IVyoun8aKpDPrhYm09PJYhbyHWB9Oiw908IvYniyyUOFpHL+fnOhGMhK3SA4zUJJrnwp 3l8K9+1+DyaXdonfzaVJ4bZN1dEhv2TxeXVNn5yTjAdK6kBub8VLx/SGxrYctbWq5UYt Z7Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=k6txQegu9OD440w4RyUERdPpBQmZU3L8gfMRAAvylWk=; b=f3LHw9NTNt77Y+t10gVJl+FZZ42UVkfSz56uGFoSaSrl0L5qmaLb9DQ1fMD8qaQweA u7KJf2svWZH2NoD7Ko5NajjIIxyo3BQM9+5gpSmcExISiOGsuZ9Xajgpjd9RWxBLsgsh 3IrxIJlILMrxsnTOBU4XyH4p8l0jCrmSdNmazYpFGCL8AI2vfW67s0v/Pkhd4BZJKKHS HSWxRg/pck3lV4wIowL+ZdqkQBBBzD2j77pFaRYl8IVTTX4vLlDqkaX+tM3qzlleB+pP qEfjEKHYbIGtTjYtdQH5bW7dxOIma7ekv6QE6Fb7zCxBnALQl1VbegTeVKs6sgHepE7e JOAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ZpHg/eAd"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rl4si3100070ejb.648.2020.07.27.07.32.18; Mon, 27 Jul 2020 07:32:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ZpHg/eAd"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731757AbgG0OVj (ORCPT + 99 others); Mon, 27 Jul 2020 10:21:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:50192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731736AbgG0OVf (ORCPT ); Mon, 27 Jul 2020 10:21:35 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CCB542070A; Mon, 27 Jul 2020 14:21:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859695; bh=kLEHju0KVoJDbYE61TY9rQc9V4gcT5FyCvKtiHi0cDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZpHg/eAdmlKd5Ez7pNo0zy46PeRBsBIn+giF0kGxvKy+tzv+b/un63cA9ajnaKb22 t1lA01k6dyzQolcheT5dwIgMgQFiePqI5cr5LmWlIG0ZBynDbgoxuo51TM/IypfdPF JzFG/RJ8ol3q/48pHQPwytfe1kU4IB7zrrkjGeHc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liu Jian , Ido Schimmel , "David S. Miller" , Sasha Levin Subject: [PATCH 5.7 069/179] mlxsw: destroy workqueue when trap_register in mlxsw_emad_init Date: Mon, 27 Jul 2020 16:04:04 +0200 Message-Id: <20200727134936.031965866@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liu Jian [ Upstream commit 5dbaeb87f2b309936be0aeae00cbc9e7f20ab296 ] When mlxsw_core_trap_register fails in mlxsw_emad_init, destroy_workqueue() shouled be called to destroy mlxsw_core->emad_wq. Fixes: d965465b60ba ("mlxsw: core: Fix possible deadlock") Signed-off-by: Liu Jian Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlxsw/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index e9ccd333f61dd..d6d6fe64887b3 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -710,7 +710,7 @@ static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core) err = mlxsw_core_trap_register(mlxsw_core, &mlxsw_emad_rx_listener, mlxsw_core); if (err) - return err; + goto err_trap_register; err = mlxsw_core->driver->basic_trap_groups_set(mlxsw_core); if (err) @@ -722,6 +722,7 @@ static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core) err_emad_trap_set: mlxsw_core_trap_unregister(mlxsw_core, &mlxsw_emad_rx_listener, mlxsw_core); +err_trap_register: destroy_workqueue(mlxsw_core->emad_wq); return err; } -- 2.25.1