From patchwork Fri Jul 24 18:23:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11684007 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7AD24913 for ; Fri, 24 Jul 2020 18:24:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6276B207BB for ; Fri, 24 Jul 2020 18:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595615092; bh=x7xMPArX2Q8l2DRbmFscnClk9ELgBMvWmqASsxDhbfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DPfHYc9NBFIAdGbfd4ay386amYjh/DvmD7PDrDFdDfturNrTXZF07VZIKWbFu5uZH jDqVGy+pMe6QzgBpn3dFMRgn2T9N4mcCKIKGntIPgcsgnsoJqryRscwoML7awJtGAp 369w1g+Rn99IlSCFkhy4WT1Jj6T3DJ0VLacS69sA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727769AbgGXSYs (ORCPT ); Fri, 24 Jul 2020 14:24:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:33570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727089AbgGXSYr (ORCPT ); Fri, 24 Jul 2020 14:24:47 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.213]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C59D2070E; Fri, 24 Jul 2020 18:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595615087; bh=x7xMPArX2Q8l2DRbmFscnClk9ELgBMvWmqASsxDhbfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j31dWumhoDOzSWirJxjWIezRfGLMLhjbROt5uNI8OIOlYwx76qTFnhOAKg0DKEsmi 67JXGcHTpUlZS+i63RgYBLAeKpFN5z0+wIT9YBUWzHmPtKEsLMHP5JkNNtGf8KpEJx pLaaUXFbqLOGCcqs9k64pNZTjlD786U8B6GUuPlE= From: Krzysztof Kozlowski To: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Russell King , Catalin Marinas , Will Deacon , Krzysztof Kozlowski , Markus Mayer , Roger Quadros , Tony Lindgren , Vladimir Zapolskiy , Kukjin Kim , Lukasz Luba , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org Cc: Olof Johansson , Arnd Bergmann Subject: [RFT 08/16] memory: omap-gpmc: Use WARN() instead of BUG() on wrong free Date: Fri, 24 Jul 2020 20:23:20 +0200 Message-Id: <20200724182328.3348-9-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724182328.3348-1-krzk@kernel.org> References: <20200724182328.3348-1-krzk@kernel.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Since driver tracks reserved memory, freeing a non-reserved GPMC should not be fatal and crash the system. Printing a warning is friendlier. Signed-off-by: Krzysztof Kozlowski --- Not tested on HW. --- drivers/memory/omap-gpmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 9339a7c75fdd..414bfb481266 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -1072,8 +1072,7 @@ void gpmc_cs_free(int cs) spin_lock(&gpmc_mem_lock); if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) { - printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); - BUG(); + WARN(1, "Trying to free non-reserved GPMC CS%d\n", cs); spin_unlock(&gpmc_mem_lock); return; }