Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2564198lkm; Mon, 20 Sep 2021 18:50:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUbEf6+iNsmgli1lO+oCjbDMm7IWEspzclfS7u/Gt+YHs1kOiVhQwbmbzMj9IzWKAGD+wn X-Received: by 2002:a17:906:dbf0:: with SMTP id yd16mr31854032ejb.445.1632189000115; Mon, 20 Sep 2021 18:50:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632189000; cv=none; d=google.com; s=arc-20160816; b=ZQARvG5CXKz8Si6m+LXtMxZ3A14GLfcAjpz3T9brM5flb5z2pDa47uQZDoEpE/BBCF Li5+KIccNwGFnbSf4stzqNoo8O5u9TGKVi7ivgV3VXcvrVD91U5KV+Z/kbDcvPxUHArK dumzindkOvtqAS6e1TBW4k9VDJFPUW92CLb+WxvLuLYftoEQz+1WqxBX6SJCd9u9tHAu Lx2DGsQ+x0TXlkKVItaEXgwZHcinD3/EhRiaCTP9HEEO+LZwmA1tNRLFPWedJSmzo4Kf zWA/zYygkVeG/DV74EDzHuCz09VTW6edbK6+/qGwYMfqlQU6hzguUWea9HfuDifF/S/u W8Zg== 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=2J59MXqc95xtfOpbv9FqKWD549gBhPVhTTtJRQElqFc=; b=lhlo7q5lIP6Ws86y5mQgRotpXckqoaAyORyZtomGJwFK2Jin8p2Bwul3VL07TvczVy 0Nn9AMChrJisAJOFTZpl9VVCa3RmTcOQzyEq1IsXIK7fU+I/ulYXWqWEX8+je+WTSlRJ N3bLzqxTMMkWfMXQ33h2NJuJ0F5g3YQpco3oMROGuX3uKpyCW0pLL/HUi8PaozmxwxJB mcAsIvaSLvvhRDk7JIgI7fUrzah9ssnhh5ryVBtTFOZDlqxze+qj/F9tSVi0lKS238Eh sDcJSZrgNrfHDOLjMf+wFyxoHJqvfadmTTnjQzsPOVMAGyeemYBXcNtUqH0wLmFaAaD9 nGeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=egTypqTF; 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 i9si17457066edq.334.2021.09.20.18.49.37; Mon, 20 Sep 2021 18:50:00 -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=egTypqTF; 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 S1355604AbhITRzd (ORCPT + 99 others); Mon, 20 Sep 2021 13:55:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:53088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354253AbhITRtY (ORCPT ); Mon, 20 Sep 2021 13:49:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 75BD4613A1; Mon, 20 Sep 2021 17:11:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157898; bh=PsY7ktnYAxpVXAlPenEeg0jBUhml0Zf7q5eBZJDIkrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=egTypqTFIyoVYDnFNnR3CPDA/yR91niwXObarxFM7disfAw51mrsF1hOiy9rfYQee a9TRJLTXF+4RSGGdg3WQKi+JV250zRRZ5BPzbPw/vlwxAT3Q3ovqK+ek/8b1G+oGT4 agny1nfL9onBoFkstisUQ/2uBezLJg8v35uRKy+I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 202/293] ata: sata_dwc_460ex: No need to call phy_exit() befre phy_init() Date: Mon, 20 Sep 2021 18:42:44 +0200 Message-Id: <20210920163940.178382500@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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: Andy Shevchenko [ Upstream commit 3ad4a31620355358316fa08fcfab37b9d6c33347 ] Last change to device managed APIs cleaned up error path to simple phy_exit() call, which in some cases has been executed with NULL parameter. This per se is not a problem, but rather logical misconception: no need to free resource when it's for sure has not been allocated yet. Fix the driver accordingly. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210727125130.19977-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/ata/sata_dwc_460ex.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index 6f142aa54f5f..8487048c5ec9 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c @@ -1253,24 +1253,20 @@ static int sata_dwc_probe(struct platform_device *ofdev) irq = irq_of_parse_and_map(np, 0); if (irq == NO_IRQ) { dev_err(&ofdev->dev, "no SATA DMA irq\n"); - err = -ENODEV; - goto error_out; + return -ENODEV; } #ifdef CONFIG_SATA_DWC_OLD_DMA if (!of_find_property(np, "dmas", NULL)) { err = sata_dwc_dma_init_old(ofdev, hsdev); if (err) - goto error_out; + return err; } #endif hsdev->phy = devm_phy_optional_get(hsdev->dev, "sata-phy"); - if (IS_ERR(hsdev->phy)) { - err = PTR_ERR(hsdev->phy); - hsdev->phy = NULL; - goto error_out; - } + if (IS_ERR(hsdev->phy)) + return PTR_ERR(hsdev->phy); err = phy_init(hsdev->phy); if (err) -- 2.30.2