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 E3489E95A8E for ; Mon, 9 Oct 2023 13:25:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376382AbjJINZ5 (ORCPT ); Mon, 9 Oct 2023 09:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376537AbjJINZ4 (ORCPT ); Mon, 9 Oct 2023 09:25:56 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7326AB for ; Mon, 9 Oct 2023 06:25:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3618CC433C8; Mon, 9 Oct 2023 13:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696857953; bh=C/F6dpMEaAnoZSlCQEIyhqTJsPDc0kqa9lgVaCHY3UE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mlYX5nkrwK+ud+ht5CKkkMywicMgGj0A26Abq3S95zYng+eO8diTQQ8Xqot+A+EWq IDBKbt/agfhB2sz5hVOWpq8XBYO0XkdiGDEVjt3isaIvuVllMcMrwjiP4BUfAPYGCG 8OHbciWdxOybEb9KF5a+HBhVBydvJ2o6XdrQeS64= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dinghao Liu , Vadim Feodrenko , "David S. Miller" , Sasha Levin Subject: [PATCH 5.15 46/75] ptp: ocp: Fix error handling in ptp_ocp_device_init Date: Mon, 9 Oct 2023 15:02:08 +0200 Message-ID: <20231009130112.843267006@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009130111.200710898@linuxfoundation.org> References: <20231009130111.200710898@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dinghao Liu [ Upstream commit caa0578c1d487d39e4bb947a1b4965417053b409 ] When device_add() fails, ptp_ocp_dev_release() will be called after put_device(). Therefore, it seems that the ptp_ocp_dev_release() before put_device() is redundant. Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.") Signed-off-by: Dinghao Liu Reviewed-by: Vadim Feodrenko Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/ptp/ptp_ocp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c index e238ae8e94709..7a4a06148515a 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -1292,7 +1292,6 @@ ptp_ocp_device_init(struct ptp_ocp *bp, struct pci_dev *pdev) return 0; out: - ptp_ocp_dev_release(&bp->dev); put_device(&bp->dev); return err; } -- 2.40.1