Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1112431pxx; Tue, 27 Oct 2020 08:31:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMMWNEcOOvQUpxtW6ymgU/R+92uSwUzjRZog36fN4UXCqDW77KVPG0DyeszU68+DgYOlNm X-Received: by 2002:a17:906:fb86:: with SMTP id lr6mr2931656ejb.510.1603812684323; Tue, 27 Oct 2020 08:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603812684; cv=none; d=google.com; s=arc-20160816; b=IHUiWjZ54cI8iBghTzxiaVgGHd/Q30ZHKN+sxtaEsEfeBhE+o0/IwOh3/lASUbr7a7 pWjB2tyNEvDizL92z0y8Yispc/WXYmpjdFQKOk7e7xHI+8WWZornesIgJx1HILfvbAS7 xhCBDjf1LwVBZqLew1fF+67xYInS1uoue7CYowkmPb/aUCH6fbJn5o6a2+JfJ6MAxXkj lSWvwGetLMqjvoJQkyqo6UJgzzS6h7FyOW8D7ejJ1tHpYXjq1pBJfYsR3RJd1KQXHIy+ xUcdIYdxi5mi54So17/FynJ8CSy9va+2QLwTZVuqCsnueEleNBkClf1JQo04tL6vW6Jp HQ3g== 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=7JPPW23g/FCYcSY/Smzt3sskhiouTHt+RjHXp/Sc1kY=; b=uJuZ4FltPzqEs4BkzycGdZ+UPDz7VbDTB8qoczDmzoX/jK1otc6Cr30kyniLXElme+ QQ8K+f2wrs1jAHk4RNojjrb7eiqFnEOvoWN2yZ1kVTToNmh3dPtAM5ukD+1VZaVREtpw T4/Psz/36wk3cPMI4jMH9Kmv19TdU4fimXGMea/521rwW9dpdugPaigXIN4bO0EMglcQ +z2mb+PZSa2xXkMEf5JWq+rnSCle99B4sRQ0KTYSCTaKI/xz9JhddWvxwnQvZV4QiLpw pzHIE0qKCXhsQSd7ZXPosrhgvyc8sRUV7KPHqvInDfJ3OQCn97Kb/Vwfw6UYzgcsWdVw pLWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k5Y9jMoA; 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 x13si1085983edq.569.2020.10.27.08.31.01; Tue, 27 Oct 2020 08:31:24 -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=k5Y9jMoA; 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 S1750006AbgJ0Oj1 (ORCPT + 99 others); Tue, 27 Oct 2020 10:39:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:38604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761377AbgJ0OjS (ORCPT ); Tue, 27 Oct 2020 10:39:18 -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 00A5321D7B; Tue, 27 Oct 2020 14:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809557; bh=ZQexqeaTE382xZxYzKHcH+8OjHTVMFDNVJFVDY40pPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k5Y9jMoARFjS+Ck554XZxdQfwQaek4joiFiiJBEsSZ456wq2P/bD/KNhfhWISP48y QXcXbr+nQ3/RL+rZ2LbQqW3+d0qWFUNiaI3Bg8auRR3WBwmRJOclnDckx8lQ/C+117 RAB63FSd8PWfnFSXf776VmHsqjSd9vHjCtGUW9oo= 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.4 238/408] mtd: rawnand: vf610: disable clk on error handling path in probe Date: Tue, 27 Oct 2020 14:52:56 +0100 Message-Id: <20201027135506.097089072@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 6b399a75f9aec..b6f114da57143 100644 --- a/drivers/mtd/nand/raw/vf610_nfc.c +++ b/drivers/mtd/nand/raw/vf610_nfc.c @@ -850,8 +850,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