Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2339649pxb; Mon, 20 Sep 2021 19:22:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrM5r3W9ib62bWrDmS2mPkMQI4GZrHzJy3Q7KNeE5x6FoiIpylS0rsnlc93K/O2l8LxO8n X-Received: by 2002:a05:6402:358a:: with SMTP id y10mr32047743edc.238.1632190945715; Mon, 20 Sep 2021 19:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632190945; cv=none; d=google.com; s=arc-20160816; b=nZsO6j1edlvElkkX6n1lKhIKyCvZSl65d1ZVibQfgOEn12ZaqCtAhAyZPTo1X1diOa BUzZ/dQVd4K2F+YFa7eChmyZuiWf66sEsJw4yID2NEvpHI5PzmB8RJwKnE823Zg5spgG X2sAsZLT1y0WwCGUGuJ7GOKDpzOHNSgYhJcX2cqJARxsUpGuc6a6ceCU0Ib1t0m1rlJl y1bISr5wDfsqonB36+3deYu5LEc5retgq0V1pR0VlmpbaDMx6b24wD1iudsiAdAL9YI5 ILe1n+0V75YH8C+ncwq7IJxxENk37bYtJet7IxEoIu4pPcNIm8ICtFuMXVsBE3JWvb7m 9nEQ== 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=PZtRn8FWRrYavPWhj6svw2aCsrH9IdIG3G35Fjd0AuYkKls2FqND3dmlZ9ga6KXJFZ 9swdLjgaiSf4ItRLpT3f7+/FNDSFmSxj3hzO0H2VkrKgY55hsEt4Vd+qxOAaXAoOj0z/ dPEiM9Ukk7UYK9jYAvekwBEx5YRZWSmjmGvjX/xo819KQq8TMDIAISh5Lde60lYxp71O ALmHKrLdMo50eGoDZlt5dmQ/AKUGsO/wycTZZXzKRF3EN5kiQsV9k7Ya+gZ2/liGpbFd 2WT91zQrhLIDepWWcBj1E+fSS5LRS460cYm27a02zpLemSViUpRS8JyQsVGyi5pSMPaz A+gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zCqkp6Us; 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 p6si18771904edy.476.2021.09.20.19.22.02; Mon, 20 Sep 2021 19:22:25 -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=zCqkp6Us; 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 S1347169AbhITSNE (ORCPT + 99 others); Mon, 20 Sep 2021 14:13:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:35752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359041AbhITSJM (ORCPT ); Mon, 20 Sep 2021 14:09:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8CEF361A08; Mon, 20 Sep 2021 17:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158341; bh=R5DxAoygujqDzBMuS+3iVJzTamDZS/jf4GHwAfptkMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zCqkp6Us+0XJMXtDhIrP/211I+jLw5QBAgxyVYUxWt78zCaLhlUIpX4mYjxnZbcJW 6+mvvCcEABRehOsRgCSrCUuVQwz9Mf67AydoVNr9DcpIUjWm+fPmv8eEtsvzmoFxvn DZZS03DjguZqnxnOZoiS8g3Vwzc1qGv/hk8oRx/g= 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.4 111/260] ata: sata_dwc_460ex: No need to call phy_exit() befre phy_init() Date: Mon, 20 Sep 2021 18:42:09 +0200 Message-Id: <20210920163934.907731061@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@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