Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device()

Return on error directly from the BAR-iterating loop instead of
break+return.

This is actually a cosmetic fix, since it would be highly unusual to
have this called for a PCI device without any memory BARs.

Fixes: 9d69ef183815 ("fbdev/core: Remove remove_conflicting_pci_framebuffers()")
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/e75323732bedc46d613d72ecb40f97e3bc75eea8.1666829073.git.mirq-linux@rere.qmqm.pl

authored by

Michał Mirosław and committed by
Thomas Zimmermann
e0ba1a39 b3af8438

+1 -4
+1 -4
drivers/video/aperture.c
··· 340 340 size = pci_resource_len(pdev, bar); 341 341 ret = aperture_remove_conflicting_devices(base, size, primary, name); 342 342 if (ret) 343 - break; 343 + return ret; 344 344 } 345 - 346 - if (ret) 347 - return ret; 348 345 349 346 /* 350 347 * WARNING: Apparently we must kick fbdev drivers before vgacon,