diff options
| author | Myeonghun Pak <mhun512@gmail.com> | 2026-09-14 20:52:43 -0400 |
|---|---|---|
| committer | Helge Deller <deller@gmx.de> | 2026-09-15 09:18:32 +0200 |
| commit | 24bebfdb76ecdf52ebe63cba4cf5913dbce3439d (patch) | |
| tree | a50763dfd372c9ab2addba402d7f9c893b1efd38 | |
| parent | c3e75b6b8c16a0f5682e7ce937db00ca81060d5f (diff) | |
| download | linux-next-24bebfdb76ecdf52ebe63cba4cf5913dbce3439d.tar.gz linux-next-24bebfdb76ecdf52ebe63cba4cf5913dbce3439d.zip | |
fbdev: kyro: Release WC setup on registration failure
If register_framebuffer() fails, kyrofb_probe() frees the framebuffer
without releasing its write-combining range. Release the range before
freeing the framebuffer. Earlier failures still skip this cleanup.
The missing cleanup already exists in the initial Git import, before
the conversion from mtrr_add() to arch_phys_wc_add().
This issue was identified during our ongoing static-analysis research
while reviewing kernel code.
Cc: stable@vger.kernel.org
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
| -rw-r--r-- | drivers/video/fbdev/kyro/fbdev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/fbdev/kyro/fbdev.c b/drivers/video/fbdev/kyro/fbdev.c index c23738988822..94d6af54e6c4 100644 --- a/drivers/video/fbdev/kyro/fbdev.c +++ b/drivers/video/fbdev/kyro/fbdev.c @@ -765,7 +765,7 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) fb_memset_io(info->screen_base, 0, size); if (register_framebuffer(info) < 0) - goto out_free_fb; + goto out_free_wc; fb_info(info, "%s frame buffer device, at %dx%d@%d using %ldk/%ldk of VRAM\n", info->fix.id, @@ -776,6 +776,8 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) return 0; +out_free_wc: + arch_phys_wc_del(currentpar->wc_cookie); out_free_fb: framebuffer_release(info); |
