From patchwork Thu Aug 1 20:34:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13750895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3C6FC3DA4A for ; Thu, 1 Aug 2024 20:36:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 637EB10E0F8; Thu, 1 Aug 2024 20:36:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="PAfL57iQ"; dkim-atps=neutral Received: from msa.smtpout.orange.fr (smtp-83.smtpout.orange.fr [80.12.242.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6B31810E0F8 for ; Thu, 1 Aug 2024 20:36:02 +0000 (UTC) Received: from fedora.home ([90.11.132.44]) by smtp.orange.fr with ESMTPA id ZcVmsD1jSGdLxZcVnsXLwg; Thu, 01 Aug 2024 22:34:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1722544499; bh=Xt0EwvNrOXd4uCSAzGoq0YIsCyBB78A5L44qPdMyuXU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=PAfL57iQ0ZLvibrFotWhGKkDVY2G3/37BXsTNpCqDxRURps7ZEsUwvToXKtGVlJ8I TuRAFWL9YSGx53PF6y3SYahGr3hhKfDV2wXbhdzID/gMmLqdtRhLedSqSwRl9v9mQn JkFp0ADsHj+c9eZKNZ8Dyi5ib9qxHFHc38GcNcd7lQz9Ajt2gDuETZ1TY8/ou9tMHb VVVk08XIewv0oWpl1D6aF47B4q8TQbDf62xklc7h0uF5fcATKWzJyIS4UgoIkmh/9n AQSeUxr+aUl5XH5N93Y1iNjGUU64Ozn8dD/QtUFirnAVLBvhSkDXQN7YZn3qbLKkB6 /cupi8Id6foVQ== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 01 Aug 2024 22:34:59 +0200 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: Helge Deller Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2] fbdev/hpfb: Fix an error handling path in hpfb_dio_probe() Date: Thu, 1 Aug 2024 22:34:39 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If an error occurs after request_mem_region(), a corresponding release_mem_region() should be called, as already done in the remove function. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Christophe JAILLET --- *Not* even compile tested only. It is provided as-is Changes in v2: - Apply a minimal change [Helge Deller] v1: https://lore.kernel.org/all/dc4fe3d857849ac63131c5620f1bacf1a3d7172e.1722191367.git.christophe.jaillet@wanadoo.fr/ --- drivers/video/fbdev/hpfb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/fbdev/hpfb.c b/drivers/video/fbdev/hpfb.c index 66fac8e5393e..a1144b150982 100644 --- a/drivers/video/fbdev/hpfb.c +++ b/drivers/video/fbdev/hpfb.c @@ -345,6 +345,7 @@ static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent) if (hpfb_init_one(paddr, vaddr)) { if (d->scode >= DIOII_SCBASE) iounmap((void *)vaddr); + release_mem_region(d->resource.start, resource_size(&d->resource)); return -ENOMEM; } return 0;