From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 950D3336EDA; Fri, 9 Jan 2026 12:32:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961927; cv=none; b=A2uMdqaJQUzGFNmFuRL05nOgYtfhCh7TL/BhTXGxs9Dgv6tfUVZHhd6RKCRVN4W9ayrVMHf91fyLRNLz2NKkWJwW2icwsfNMWwDakta8lpzPq7L6GKIeEk3XxawTlNmNbze3x/jYPXe/yJGacgvzZ0KzDVYs0JoQJuYvT7o0qtQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961927; c=relaxed/simple; bh=pCt9L5GlTOzLmmIIJNUbXP3A7Cx8c8vvWydPlZtRCtw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oC+s/LGtw2mPpHlwAKjy4K6SiaHxYca0SyJEI6f74d014tkeZjbFdkpPIKv6HGeeRyD9kkd2O9FccJtOzDZ/7woyLytlbqJWe5YrpjgexgN7iWck87kUToNQvEpvhHNsST/Y+jh+Ztf0JREzzA8mSNN8XYi+Pj+YnaamDHRkg6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bl+4+LGd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bl+4+LGd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DFC9C4CEF1; Fri, 9 Jan 2026 12:32:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767961927; bh=pCt9L5GlTOzLmmIIJNUbXP3A7Cx8c8vvWydPlZtRCtw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bl+4+LGdwiHux5KCiS/QP1QCcGpcOIDF6STZMDcQZfsch5tvtC4kdQX15rgWQ4bv4 xqrU7RbOai9c6bByBD5Vk/lcHefK9YkFyYjbJ0/4byDZ1lRQ4S9PZbQT9aJr1n7U3I 0UeZwAB/C9XhFTcEhRinEJIaHN/cXZMkwt7XheK4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Abdun Nihaal , Helge Deller , Sasha Levin Subject: [PATCH 6.1 186/634] fbdev: ssd1307fb: fix potential page leak in ssd1307fb_probe() Date: Fri, 9 Jan 2026 12:37:44 +0100 Message-ID: <20260109112124.438940796@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112117.407257400@linuxfoundation.org> References: <20260109112117.407257400@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Abdun Nihaal [ Upstream commit 164312662ae9764b83b84d97afb25c42eb2be473 ] The page allocated for vmem using __get_free_pages() is not freed on the error paths after it. Fix that by adding a corresponding __free_pages() call to the error path. Fixes: facd94bc458a ("fbdev: ssd1307fb: Allocate page aligned video memory.") Signed-off-by: Abdun Nihaal Signed-off-by: Helge Deller Signed-off-by: Sasha Levin --- drivers/video/fbdev/ssd1307fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 5c891aa00d596..b9fefa844574e 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -732,7 +732,7 @@ static int ssd1307fb_probe(struct i2c_client *client) if (!ssd1307fb_defio) { dev_err(dev, "Couldn't allocate deferred io.\n"); ret = -ENOMEM; - goto fb_alloc_error; + goto fb_defio_error; } ssd1307fb_defio->delay = HZ / refreshrate; @@ -812,6 +812,8 @@ static int ssd1307fb_probe(struct i2c_client *client) regulator_disable(par->vbat_reg); reset_oled_error: fb_deferred_io_cleanup(info); +fb_defio_error: + __free_pages(vmem, get_order(vmem_size)); fb_alloc_error: framebuffer_release(info); return ret; -- 2.51.0