* [PATCH] fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device()
@ 2022-10-27 0:06 ` Michał Mirosław
0 siblings, 0 replies; 4+ messages in thread
From: Michał Mirosław @ 2022-10-27 0:06 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: Javier Martinez Canillas, Helge Deller, dri-devel, linux-fbdev,
linux-kernel
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>
---
drivers/video/aperture.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c
index 9e6bcc03a1a4..41e77de1ea82 100644
--- a/drivers/video/aperture.c
+++ b/drivers/video/aperture.c
@@ -340,12 +340,9 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na
size = pci_resource_len(pdev, bar);
ret = aperture_remove_conflicting_devices(base, size, primary, name);
if (ret)
- break;
+ return ret;
}
- if (ret)
- return ret;
-
/*
* WARNING: Apparently we must kick fbdev drivers before vgacon,
* otherwise the vga fbdev driver falls over.
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device()
@ 2022-10-27 0:06 ` Michał Mirosław
0 siblings, 0 replies; 4+ messages in thread
From: Michał Mirosław @ 2022-10-27 0:06 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: linux-kernel, Helge Deller, Javier Martinez Canillas, dri-devel,
linux-fbdev
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>
---
drivers/video/aperture.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c
index 9e6bcc03a1a4..41e77de1ea82 100644
--- a/drivers/video/aperture.c
+++ b/drivers/video/aperture.c
@@ -340,12 +340,9 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na
size = pci_resource_len(pdev, bar);
ret = aperture_remove_conflicting_devices(base, size, primary, name);
if (ret)
- break;
+ return ret;
}
- if (ret)
- return ret;
-
/*
* WARNING: Apparently we must kick fbdev drivers before vgacon,
* otherwise the vga fbdev driver falls over.
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device()
2022-10-27 0:06 ` Michał Mirosław
@ 2022-10-27 7:56 ` Thomas Zimmermann
-1 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2022-10-27 7:56 UTC (permalink / raw)
To: Michał Mirosław
Cc: Javier Martinez Canillas, Helge Deller, dri-devel, linux-fbdev,
linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1429 bytes --]
Hi
thanks for the patch. Added to drm-misc-fixes.
Best regards
Thomas
Am 27.10.22 um 02:06 schrieb Michał Mirosław:
> 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>
> ---
> drivers/video/aperture.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c
> index 9e6bcc03a1a4..41e77de1ea82 100644
> --- a/drivers/video/aperture.c
> +++ b/drivers/video/aperture.c
> @@ -340,12 +340,9 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na
> size = pci_resource_len(pdev, bar);
> ret = aperture_remove_conflicting_devices(base, size, primary, name);
> if (ret)
> - break;
> + return ret;
> }
>
> - if (ret)
> - return ret;
> -
> /*
> * WARNING: Apparently we must kick fbdev drivers before vgacon,
> * otherwise the vga fbdev driver falls over.
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device()
@ 2022-10-27 7:56 ` Thomas Zimmermann
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2022-10-27 7:56 UTC (permalink / raw)
To: Michał Mirosław
Cc: linux-kernel, Helge Deller, Javier Martinez Canillas, dri-devel,
linux-fbdev
[-- Attachment #1.1: Type: text/plain, Size: 1429 bytes --]
Hi
thanks for the patch. Added to drm-misc-fixes.
Best regards
Thomas
Am 27.10.22 um 02:06 schrieb Michał Mirosław:
> 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>
> ---
> drivers/video/aperture.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c
> index 9e6bcc03a1a4..41e77de1ea82 100644
> --- a/drivers/video/aperture.c
> +++ b/drivers/video/aperture.c
> @@ -340,12 +340,9 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na
> size = pci_resource_len(pdev, bar);
> ret = aperture_remove_conflicting_devices(base, size, primary, name);
> if (ret)
> - break;
> + return ret;
> }
>
> - if (ret)
> - return ret;
> -
> /*
> * WARNING: Apparently we must kick fbdev drivers before vgacon,
> * otherwise the vga fbdev driver falls over.
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-10-27 7:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27 0:06 [PATCH] fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device() Michał Mirosław
2022-10-27 0:06 ` Michał Mirosław
2022-10-27 7:56 ` Thomas Zimmermann
2022-10-27 7:56 ` Thomas Zimmermann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.