Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1683907pxb; Thu, 16 Sep 2021 12:55:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyy20IJi3ctLQKr9rkFQBrs/2pFr9UNfF1qQMLyCygA9wjcQFXO+znSeKbEaY8jFJFSnvvH X-Received: by 2002:a6b:b7d6:: with SMTP id h205mr2363794iof.60.1631822106600; Thu, 16 Sep 2021 12:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631822106; cv=none; d=google.com; s=arc-20160816; b=ai1MtJBRpWrVgOsAHQmtQq6rPEwS6D45TTW0GYVp1aOhVaoS923hPJSTbk77doHYsR i6sJiplyzVimGTZt65YwDtVbowT6O07Hwkcik8E4v2WSWdD1HntDR7Fw/Dl7RHQ9QI0m 5fSqbaeKuBZObIFSDXqhcioGQMSRgGVrSV6CegRQg/285L51wtEGD48VO75w6a82pgXM uDcp9I5X1nwjBwKHurYjNOicOeEV0sn2uN75RZ8IO2V+geNfWDI49XEzq8eDez9jkYQd bNF9fSjrpUFh4KWGbz9lpQJT2+smucPISo38nB+NPseqXCpNePES4hEPBW8my8sQ76M9 NT6A== 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=LC5/vl99IidJPiRpzSG85Vsvu254N5qKjfm7Fb6yYDE=; b=jeXBazrzzt14uY+QpkunCADxyy/JhwTl7KTOSvthAOOgjpCntBSmvumTuhvgKS2iIS AUc0OU8EtvpjtBvD+yH1MX+nQfIgY7adY2ro7X6nhZev+7250J4KkwnLBww0tnIPx8oZ L6lHzEcxkpfWbNi7Xg9Q5Mfba3z4EYGKNomoh6CBZHqWJOS/E0V82/2tu7KIXuUSQFhR XPZfjN1LGfqEX2p+GeIWOATJjYHophxU++xHqug/JybdwYVLthjEgiWTu9q8iJIR7tT/ zJNl47KL1TRSE9igU5l0dFFed406DH1Ub4HIuB3iibb/AkUn2fQXzeUpyyVxJcNHs18a oWyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pPJpRWHz; 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 s16si3235911ilh.179.2021.09.16.12.54.44; Thu, 16 Sep 2021 12:55:06 -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=pPJpRWHz; 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 S241893AbhIPQWx (ORCPT + 99 others); Thu, 16 Sep 2021 12:22:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:55068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240860AbhIPQOd (ORCPT ); Thu, 16 Sep 2021 12:14:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0534D60698; Thu, 16 Sep 2021 16:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808642; bh=R5DxAoygujqDzBMuS+3iVJzTamDZS/jf4GHwAfptkMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pPJpRWHzGjpL5lTWDZak0zDE+TqzaZOasWGSQbBWMNYTvGvnT6HEuS0n+xhzBVvR+ Yu6OrtU3FBf/ggJCVwU7kCnXm4nWwS2dve4eoYAXXQo/1qwKviHPOQ44RYxhAGJkZU 8+I2wXtyEGIHUqrNHZU/JskNxUIsusQMJfVDyF50= 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 5.10 168/306] ata: sata_dwc_460ex: No need to call phy_exit() befre phy_init() Date: Thu, 16 Sep 2021 17:58:33 +0200 Message-Id: <20210916155759.806048655@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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 9dcef6ac643b..982fe9112532 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c @@ -1249,24 +1249,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