Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2353728pxb; Mon, 20 Sep 2021 19:52:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI558ymCUqJSnupplB07PTRaMTg6xnVyK6dBLj+0Vd4Kijar37uAsALgtm8XEVVgUaKcg2 X-Received: by 2002:a50:da0a:: with SMTP id z10mr4781356edj.298.1632192746825; Mon, 20 Sep 2021 19:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192746; cv=none; d=google.com; s=arc-20160816; b=IF5tUJb6K9J/wq3082KlabO0CCnl/adQ2/a/vppwsEG8yxdzE0uN+BFFMNT/u1hKIO IAHkwG//UpXMlV+4ForiayDiLpX1uO5qNiN2fClP1btnvtKMiGnBqZ52HeOTID9MX8G/ OzKwwn29JgZhGWhygOq8kJA4BrsiEVe/0u6zJM8EFqYlYmWiY62rGgkFpnF3TWPdM+Yb 3BaQRCqMQyPlBY9YHav/dGBE0Ab7z/MpzY7phcCmyl/J9bb+EewSOUfNwLL8RMeEmuMM yhl3kg3onbmFWL8TQ+ifmlkSKYqc5E7++g6wAT9mmCm5HanOS5ioXFy3wtb9IBH5sBt/ bUzA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=on0RajcqLfPyiMxZ1YEm1wsk1Aly8VztWQMTPqewSZg=; b=lfnrsNw5Wutu1RloZvd2RPm3fpqvHdbGdWWaNTYnp4LBV+m+U9pkiI+galILI21gp9 zQHrPsgcY5RNnOVTaYKsyU0YAVokzAZVENgvJ2NCtI1SRLYFS0d38rGytcdnYCgyMp9j j2lxRlvnMDDlq8rB6/GpoTo4kyrmdggX/hJnrR4QvF05DhFF9cOM+vzp7VpokrVaJFg7 jgX/R152/7RUxHqWsAq5v8Jt7ziP6IV/ZHLw6XYpBw1/73G25kdrVrUxz73LqIo7MHxU EbnK0Yy9cfOQVE5S7or6Rt9+Aj2IoTFw4E+Xu23bIcXyxiE51iSVuXvCFZ4ZHZFEOtHk fH5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="d0R/+S5x"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 16si17066818ejj.116.2021.09.20.19.52.03; Mon, 20 Sep 2021 19:52:26 -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=@linuxfoundation.org header.s=korg header.b="d0R/+S5x"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345300AbhITSn1 (ORCPT + 99 others); Mon, 20 Sep 2021 14:43:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:53124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381965AbhITSjk (ORCPT ); Mon, 20 Sep 2021 14:39:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 323856333A; Mon, 20 Sep 2021 17:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159046; bh=CXCzy7tiYTN6nZ2fvrhXM7SroQ9LCi5oAHSmqNIicIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d0R/+S5xM8gv6Sq02mraBTHIkS891XrLmY9HG+SVOMVUOOJKY/9uz5UKl95G/QUzc FHIES8Gnek4Mj8Ri/2tk0pXyrc6lLvT0MlOHPeJ7QDukmht/UGFp4ND5YmWuW3l86S 4OmamJMlHoS2nWPqE09Y+9lq+K6B+a4vEB3L6J0g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Pavel Machek (CIP)" , Saeed Mahameed , Aya Levin Subject: [PATCH 5.14 051/168] net/mlx5: FWTrace, cancel work on alloc pd error flow Date: Mon, 20 Sep 2021 18:43:09 +0200 Message-Id: <20210920163923.313557941@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Saeed Mahameed commit dfe6fd72b5f1878b16aa2c8603e031bbcd66b96d upstream. Handle error flow on mlx5_core_alloc_pd() failure, read_fw_strings_work must be canceled. Fixes: c71ad41ccb0c ("net/mlx5: FW tracer, events handling") Reported-by: Pavel Machek (CIP) Suggested-by: Pavel Machek (CIP) Signed-off-by: Saeed Mahameed Reviewed-by: Aya Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c @@ -1007,7 +1007,7 @@ int mlx5_fw_tracer_init(struct mlx5_fw_t err = mlx5_core_alloc_pd(dev, &tracer->buff.pdn); if (err) { mlx5_core_warn(dev, "FWTracer: Failed to allocate PD %d\n", err); - return err; + goto err_cancel_work; } err = mlx5_fw_tracer_create_mkey(tracer); @@ -1031,6 +1031,7 @@ err_notifier_unregister: mlx5_core_destroy_mkey(dev, &tracer->buff.mkey); err_dealloc_pd: mlx5_core_dealloc_pd(dev, tracer->buff.pdn); +err_cancel_work: cancel_work_sync(&tracer->read_fw_strings_work); return err; }