Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp278570pxx; Wed, 28 Oct 2020 04:51:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAyCCo4RNjWgxm8eet4wo3xy/28r+A3sVlU8VKQ+GXuQGVFRLh02O4EEnIy11993zM0vDe X-Received: by 2002:a17:906:8058:: with SMTP id x24mr2130805ejw.272.1603885887142; Wed, 28 Oct 2020 04:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603885887; cv=none; d=google.com; s=arc-20160816; b=DysQI/8g1oeO2MxSy3e7BGO09uVha7ggYio1l3yG7ItiU2SfDc5M8OBxPp8GLf7F3E g2rEUwiFeBmUd1xekOwXKZKNKqTllobaO1tRkDke/hKiENeEVzfS5FduNPEA/uoi+nMI UByOb2+YKKQlpUx8b/FSIerd+1qOQKWIIUD1s7c+j8vKZLS/43MkHf+oZbVnmpyZqpBk Y5P+8ft3AGLkrbLNJa95OBZe6W8i64QQsO1eKJeaFT3fCD7c0cQ/yZsntr9Smjm+Uw/k 9fkRf3JFQA3TzDistLmOWygaA3ao/unGdmcAG1GynUOHkkZO4mocKZRAj6tuHajf9/Ui t9sg== 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=E8cJdQTBU3eFdGaGoKeeo4dXMkULtClXy/Wjr/aE60s=; b=N6qhZXPH+zINp9VBrIo9UsVDxVuN4WKOgUT9XrX0V1XBjtU0lsic1F6iCG21KY+me/ X777WhZO3xvLQhyfb1H7krhdsKY2j/6mIcfa+NmyVtqvJt8UYhDNvGT+9aJ0bUwD0WLM tuiuBE6Y/qJ4e7jE2gqg0vYCQ0qz2FqTbb8lGUgma9S3UQqt4At6tA4BCrn5oRcqTYHo kUjC2Qlg+flgWy1Dk7p0ZXCUAx47c4cR+Lt/2OWsxdSx6+Y48yQDJxH8YfVgXp7kK8C6 MVMsAPzCWLbT2uAzUAwTn7NPRidjJImIaMiG6EtiKU3/hZSmbuPZwoI4iFUQy3+OmMnW inCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hy51uqXg; 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=fail (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 d4si2698178edr.173.2020.10.28.04.51.05; Wed, 28 Oct 2020 04:51:27 -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=@kernel.org header.s=default header.b=Hy51uqXg; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794634AbgJ0PMp (ORCPT + 99 others); Tue, 27 Oct 2020 11:12:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:40114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1791005AbgJ0PFr (ORCPT ); Tue, 27 Oct 2020 11:05:47 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 D04E422275; Tue, 27 Oct 2020 15:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811146; bh=M/kzpbcip4o+7zdV9ri29oK4Vwl6RhReR5vq50WidzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hy51uqXg7RgPElXn0SpJ0ytUPIew3wIiJQpwg6eveKCRhJBqgU/uOzDjrHvQnpXqf pXcM0CW5qhHAUttMtRJ3AtR9oZkACVG0piLnr/PJvvVHfGtiCrNzhRdPgClGmk1F2U sRNRy04UtkM68HttOENY+4bt2bE+ZufA4zF8RXsc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evgeny Novikov , Miquel Raynal , Sasha Levin Subject: [PATCH 5.8 390/633] mtd: rawnand: vf610: disable clk on error handling path in probe Date: Tue, 27 Oct 2020 14:52:13 +0100 Message-Id: <20201027135540.998186746@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Evgeny Novikov [ Upstream commit cb7dc3178a9862614b1e7567d77f4679f027a074 ] vf610_nfc_probe() does not invoke clk_disable_unprepare() on one error handling path. The patch fixes that. Found by Linux Driver Verification project (linuxtesting.org). Fixes: 6f0ce4dfc5a3 ("mtd: rawnand: vf610: Avoid a potential NULL pointer dereference") Signed-off-by: Evgeny Novikov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200806072634.23528-1-novikov@ispras.ru Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/vf610_nfc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c index 7248c59011836..fcca45e2abe20 100644 --- a/drivers/mtd/nand/raw/vf610_nfc.c +++ b/drivers/mtd/nand/raw/vf610_nfc.c @@ -852,8 +852,10 @@ static int vf610_nfc_probe(struct platform_device *pdev) } of_id = of_match_device(vf610_nfc_dt_ids, &pdev->dev); - if (!of_id) - return -ENODEV; + if (!of_id) { + err = -ENODEV; + goto err_disable_clk; + } nfc->variant = (enum vf610_nfc_variant)of_id->data; -- 2.25.1