From patchwork Wed Feb 16 13:31:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corinna Vinschen X-Patchwork-Id: 12748625 X-Patchwork-Delegate: kuba@kernel.org 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 12482C433F5 for ; Wed, 16 Feb 2022 13:32:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234435AbiBPNcg (ORCPT ); Wed, 16 Feb 2022 08:32:36 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234513AbiBPNcZ (ORCPT ); Wed, 16 Feb 2022 08:32:25 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ECE11DF48B for ; Wed, 16 Feb 2022 05:31:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645018304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=0QIjHuV7hJqhtsH9M6EByQtK4s+qxfURN8i666BCzAQ=; b=e6RrONfuAfsFY30jtGxByJZIE15nQCW4Ty7e+cILuJg4Zl1beK8KZsk3Hz7dc+nca6w7es aokeIxzCaJPZGVaTEChx5n92cAFmtJT0EFjCvEYL2jGZDBo+t8U9qvWT0TOfwErs9DhaXy jJcWQLwb5UNhch9nHFoGR3cyVKXcxiI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-520-zZwk04vbNjy6hsQqevgSnw-1; Wed, 16 Feb 2022 08:31:39 -0500 X-MC-Unique: zZwk04vbNjy6hsQqevgSnw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE6741091DA2; Wed, 16 Feb 2022 13:31:37 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.36.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ACA02654E5; Wed, 16 Feb 2022 13:31:37 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 0692FA80D35; Wed, 16 Feb 2022 14:31:36 +0100 (CET) From: Corinna Vinschen To: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Vinicius Costa Gomes , Sasha Neftin Subject: [PATCH net v2] igc: igc_read_phy_reg_gpy: drop premature return Date: Wed, 16 Feb 2022 14:31:35 +0100 Message-Id: <20220216133135.356870-1-vinschen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org igc_read_phy_reg_gpy checks the return value from igc_read_phy_reg_mdic and if it's not 0, returns immediately. By doing this, it leaves the HW semaphore in the acquired state. Drop this premature return statement, the function returns after releasing the semaphore immediately anyway. Fixes: 5586838fe9ce ("igc: Add code for PHY support") Signed-off-by: Corinna Vinschen --- v2: Add "Fixes:" tag drivers/net/ethernet/intel/igc/igc_phy.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c index 5cad31c3c7b0..df91d07ce82a 100644 --- a/drivers/net/ethernet/intel/igc/igc_phy.c +++ b/drivers/net/ethernet/intel/igc/igc_phy.c @@ -779,8 +779,6 @@ s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 *data) if (ret_val) return ret_val; ret_val = igc_read_phy_reg_mdic(hw, offset, data); - if (ret_val) - return ret_val; hw->phy.ops.release(hw); } else { ret_val = igc_read_xmdio_reg(hw, (u16)offset, dev_addr,