Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp579118img; Fri, 22 Mar 2019 04:26:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3417WZAnXtm2lBYTBVk0bXWk4BkvRJk6/i8886JjF5ZgOLMbLWxmO+Xk86DJGGUWAj2hW X-Received: by 2002:aa7:920b:: with SMTP id 11mr8375354pfo.3.1553254011516; Fri, 22 Mar 2019 04:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553254011; cv=none; d=google.com; s=arc-20160816; b=LjlDt8FsrnGhW8oIi0pJVovUzzGbxoYfuCEyaY1bcC03PyDlk5vTb3CQjYA9qsTXBA HTcs9v9Nv1zHcmGQ1CqfRW4lehlQJav0hDGc69PcRQr7pbeR6B8efMHXsaOCzZfg1Dxv Pdkl+dIVxdbnEeDrYYXuw61Uyku+Jt9Qm+yQHhlQ3SOCoxRsAUeK7FbeGcUrc6MMMuxK l/0Fyp6Male1/DVvtbIIYMo57TcRHVTaMvevYINwueEJdiTTVpxD5w+vUv0R+lG7mbCx qiqyCr8+elfbkr42bpLSqSkGGE9g7eJCUPDPD5XNa9po1DV50O0M5FUWGTff8hTb6NU7 3Tfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RdDfSYh8dKbNZBbwxm+XxfXDTOITgVbszXRdoqMcTGY=; b=IVLu5Qnp7twn/O0FkMosWtIrxR3JwfKsym2DvRULywDvq6lP4Bbw7ZfjUlm065OiRu Xy5dyBG+lSPbOldYoX/fdoAm/LK8rdNpu2dKr1G5ruUfNZUKITujI6TYyJMFJDOJXgfv wNXVnfwxns+IXt68T78IkslhR5nBGip+szpJzz5s/bUHAmVBKUb/X8VhN9i3kHT9L0Ux J7bJhh8ThMSulvk8HGRV4xK8wVAVnW7A9wb80d8Hq+7ZuSZcPftXswV1iyuh/kEJ/UKm Kj2V+S2bMbjb/kQMhqfg6jnxYhrUsnaBIyr+F63TZoHY0Koew3VZqCM+z0v3XUlf39rd ESvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Nm8wFbpI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s26si6293254pfm.143.2019.03.22.04.26.34; Fri, 22 Mar 2019 04:26:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Nm8wFbpI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729212AbfCVLZA (ORCPT + 99 others); Fri, 22 Mar 2019 07:25:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:52162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728398AbfCVLY6 (ORCPT ); Fri, 22 Mar 2019 07:24:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 15A41218A2; Fri, 22 Mar 2019 11:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253897; bh=5pJY/SsA583MQg5Hlg0Db8h+NxkmdwU25pBFksjuRRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nm8wFbpIAi5IgSRawKe8odSEmaEFv0mzv6Jbysez3K8iryd/uPudoSVXMi7yZYA4G lS3/Ou/FYytm8lesbnX1HQPm0w09YtBq+4dV6b3KGx68sKoMVz+cuTU3rkAXD/9vWe aN2GgpndJINYiYaLWYm8BkquGd40+ntDBKhsSuXs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Khoroshilov , "David S. Miller" , Sasha Levin Subject: [PATCH 3.18 105/134] net: mv643xx_eth: disable clk on error path in mv643xx_eth_shared_probe() Date: Fri, 22 Mar 2019 12:15:18 +0100 Message-Id: <20190322111217.820321869@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit e928b5d6b75e239feb9c6d5488974b6646a0ebc8 ] If mv643xx_eth_shared_of_probe() fails, mv643xx_eth_shared_probe() leaves clk enabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/mv643xx_eth.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index d44560d1d268..5fcf026d3528 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -2814,7 +2814,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) ret = mv643xx_eth_shared_of_probe(pdev); if (ret) - return ret; + goto err_put_clk; pd = dev_get_platdata(&pdev->dev); msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ? @@ -2822,6 +2822,11 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) infer_hw_params(msp); return 0; + +err_put_clk: + if (!IS_ERR(msp->clk)) + clk_disable_unprepare(msp->clk); + return ret; } static int mv643xx_eth_shared_remove(struct platform_device *pdev) -- 2.19.1