Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2579463rdb; Fri, 22 Sep 2023 02:53:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEv5P4XLiJ29/LwwHvHulZcIeXmDPhfLtSm4aVYbWkcJvK54sibA52jXwLcjTk8WqBqD3Z7 X-Received: by 2002:a05:6a21:271c:b0:14c:c393:402d with SMTP id rm28-20020a056a21271c00b0014cc393402dmr6203562pzb.34.1695376434562; Fri, 22 Sep 2023 02:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695376434; cv=none; d=google.com; s=arc-20160816; b=g/XmJjsBXeZXAvxQF6YbY27X4Jowbyee6f2KbDUAgvhnvLOJbng0fIqwPBUSk75BeY lYjos5mip8zocuwx22pFAuD/8TDVHnYoT2NGRkQKDb9ujd12a1f3FFws4me/vNDBRcr0 1jJ8lb2D7lYx+b2uManPjUFAr1i8p+W19sOb3crt9F5K++nJfB2hTHPd4/Q8E5Z113Ps SqooCC3Hr/th8XjlYNqCjBu2i4SJPEphuF4Ybm/xI8VIU7X873ozGnVd7zgKG8OSd7Du NNAM9yul3uP3NF4dfPV4DfanOvTvULB9bsOfoJdrF4C1x7Q3OKF6pkPlQII2a9k6Shqk gTPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=tB4bDLXBXEkA77HbcgjKcqEfzSXG76dSjel/0T/bTEg=; fh=mf7coZ8r/fw4FonMRDcby6GjkA1x6lp35PNuryz8jmw=; b=T8ussJ6MBrPEweP8DMKV4FMmiZAkbI0P9LTx/jk8vucCeDVWKKrnw6M/sopTpJvdyl TnS3LPxBhAwlsBAKp2fXwNDh3LB06C8+AjGD7WmOh4USyntis71uQQ+j3PcuA2ZBjVFV EKf2aIpN/y+vb+QZb4npZXZGP8VWZIMZ6l2yQWD+tj3RZMbocLrO7xcwZWPu8il4t9ZM /ppXHpWInfSwrnXqnJyYSJ7tfU5/f2MIFKbhoQ+Jz45pmhGnNHz6df71JvOOHOu6gmJA Asp9NZekdaxabjCNiN1fKvxzlld/qkDA4Qfb+P+KSOdoYtlWU+l/Nxid8534lJVkaUM/ yEgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u15-20020a170902e5cf00b001b895a2c09esi3546057plf.381.2023.09.22.02.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:53:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4FADC8024CC2; Fri, 22 Sep 2023 02:41:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231206AbjIVJlF (ORCPT + 99 others); Fri, 22 Sep 2023 05:41:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230490AbjIVJlE (ORCPT ); Fri, 22 Sep 2023 05:41:04 -0400 Received: from zg8tmtyylji0my4xnjqumte4.icoremail.net (zg8tmtyylji0my4xnjqumte4.icoremail.net [162.243.164.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 89309192; Fri, 22 Sep 2023 02:40:57 -0700 (PDT) Received: from localhost.localdomain (unknown [10.181.203.255]) by mail-app2 (Coremail) with SMTP id by_KCgA3r3odYQ1lJWmuAA--.3668S4; Fri, 22 Sep 2023 17:40:50 +0800 (CST) From: Dinghao Liu To: dinghao.liu@zju.edu.cn Cc: Richard Cochran , Jonathan Lemon , Vadim Fedorenko , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ptp: ocp: Fix error handling in ptp_ocp_device_init Date: Fri, 22 Sep 2023 17:40:44 +0800 Message-Id: <20230922094044.28820-1-dinghao.liu@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: by_KCgA3r3odYQ1lJWmuAA--.3668S4 X-Coremail-Antispam: 1UD129KBjvdXoWrtryfWFW5ZFW3WFy5tFyfXrb_yoW3GFc_Gw 1j9FWxWryvkw1kGw1rGw1xZrWIkrnFvr47Crs5tF93A39avF45Xr98uryUGw4DWw4rGrWU ZasIqr1xAr4q9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb28Fc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AK wVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20x vE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26rxl6s0DM28EF7xvwVC2z280 aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07 x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18 McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr4 1lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48JMxAIw28IcVCjz48v1sIE Y20_GFWkJr1UJwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI 8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41l IxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIx AIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2 jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUdHUDUUUUU= X-CM-SenderInfo: qrrzjiaqtzq6lmxovvfxof0/1tbiAgAGBmUMUaAikwAHss X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 22 Sep 2023 02:41:07 -0700 (PDT) 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 --- 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 20a974ced8d6..a7a6947ab4bc 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -3998,7 +3998,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.17.1