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 7C3A927B340; Thu, 15 Jan 2026 17:45:35 +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=1768499135; cv=none; b=ix4G5/mY07KyIOGjsPaCkgJT1unuLtfgf8pxfJbqIoUBXOj+XJ5yP5vCuGR9XzwnYUkYtGI6wDu5vkrpggVr3zsTPPFbS31xSWC+O5GXik6Mko8YBT5jO63dYD5TJwJEz4xmh3aNr1wiHW1y83N/rep4bVOLcPWxCOHLIuVj2sk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768499135; c=relaxed/simple; bh=CpvYQ6JiB86W3G9kbECVp9Fm1HvJGolhNDeCGB/X5eQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k7xJvwqzt7JK9irVes2FZooGfIyHlqKuAOpghZUD0bnvN5bbUR1OPSIIixY0jTQ/R8KqAryHfmeNFZxUYO1yu1nNGSRL8J6vpZZL2EGA0G6tvTAzKoW0MhDPgdC7abNM3pL8ZNFdsH0bHdlDEJNk59WZBfNwCff4JM8D5JSkGWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=M4HcEeTd; 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="M4HcEeTd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08708C116D0; Thu, 15 Jan 2026 17:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768499135; bh=CpvYQ6JiB86W3G9kbECVp9Fm1HvJGolhNDeCGB/X5eQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M4HcEeTdTrhm6iLIikijaQhSVwNpyALXG0ACsCpPgJcF0mAiHPsBHbLti4q7NIgop Cq08lQc2pYktIBH4y/8QsOIjzZHXffB1LxZvdAggnSm3WCxq31Pw756x4lZ0MxDcaP QTC3gukosr1tnuzy7qYK3lbkD1oMPX5yrt/+wINQ= 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 5.10 119/451] fbdev: ssd1307fb: fix potential page leak in ssd1307fb_probe() Date: Thu, 15 Jan 2026 17:45:20 +0100 Message-ID: <20260115164235.228752137@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115164230.864985076@linuxfoundation.org> References: <20260115164230.864985076@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 5.10-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 eda448b7a0c9d..fd26d368fdf5c 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -676,7 +676,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; @@ -756,6 +756,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