Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1152478pxa; Thu, 6 Aug 2020 00:27:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlP3h2OqHCFHgdQ/XnN1akhEExeP45jXH3WU6GwQHqJH6KZ/1vTN6XPDNeNxAsDhMsw21t X-Received: by 2002:a50:a40e:: with SMTP id u14mr2935223edb.36.1596698831433; Thu, 06 Aug 2020 00:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596698831; cv=none; d=google.com; s=arc-20160816; b=ayfvXbCVoTiTl5S62/EfGTjHMrsfSHlLO2G9w4ZRAIe+h+dmDQ7nBU1gjkMhUwDNI+ nDgz7vfkc/FtRqfHZszN58zQIKfrp190Zn4Z8l+yr7R3DImqh12lxnVyFv/Bno21CGwn byV9/nkhIspEj4aL8O5Jv0kzRxuggyJxwIUhXrTBugZiD3/0icXE4Z6OswnhXeaqanR/ A5fXHiEUzZmb+6lROXz+tvsZRdKRQ52xc+UJEQGJ0EhNIhLrzkc64Yt5Z+H6cBxX0T45 D3twIUWI/+8XRrqhnMMKl0G2A/HiMe7GG9bI0kqw7CuvnFDBjFopVAm7HVhxSc5q8fQv TPvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=H3Zxej9zX96O2layVtggXuZONqq46u0glKs717tE8oI=; b=dXAP19emSTRlSSfqS+axzWAVuVe/AG1cA3MqEwzcsVLCzFbB+IwWh7hW3WuHuJEM8G cxLa+GhwyF7hJe+Ke6Kh0SSQYYAmk2G8iDo6MRoh8YW8smX5AA+uff5wDTGBCiMdG9q4 J1dl0xkIWlIfBbZgj/WVyaDHro2KV4jjAwU6gd9Iaasqre58cmChTl3BCeubHwQVgNHQ RFeY9qwhUBwH7ZOHNBEr8TKmOlzkPYOHovsRQd4fFK0/aos2pe0LbG+3/sPsSQAvGTBX lVlHLrEF5HXDlMnEB8IeR2O5nyk87h+CWzo0yaMLkVgROZbV8n2xp2jSZbabC9F+AeD7 QTaA== ARC-Authentication-Results: i=1; mx.google.com; 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=ispras.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si2639226edr.130.2020.08.06.00.26.49; Thu, 06 Aug 2020 00:27:11 -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; 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=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728428AbgHFH0i (ORCPT + 99 others); Thu, 6 Aug 2020 03:26:38 -0400 Received: from mail.ispras.ru ([83.149.199.84]:50820 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728334AbgHFH0i (ORCPT ); Thu, 6 Aug 2020 03:26:38 -0400 Received: from hellwig.intra.ispras.ru (unknown [10.10.2.182]) by mail.ispras.ru (Postfix) with ESMTPS id E051740D4004; Thu, 6 Aug 2020 07:26:35 +0000 (UTC) From: Evgeny Novikov To: Stefan Agner Cc: Evgeny Novikov , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Aditya Pakki , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] mtd: rawnand: vf610: disable clk on error handling path in probe Date: Thu, 6 Aug 2020 10:26:34 +0300 Message-Id: <20200806072634.23528-1-novikov@ispras.ru> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 7248c5901183..fcca45e2abe2 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.26.2