* [PATCH] drm/bochs: Return error from correct pointer
@ 2024-10-04 7:52 Thomas Zimmermann
2024-10-04 8:13 ` Javier Martinez Canillas
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Zimmermann @ 2024-10-04 7:52 UTC (permalink / raw)
To: kraxel, maarten.lankhorst, mripard, airlied, simona
Cc: virtualization, dri-devel, Thomas Zimmermann, Kees Bakker
In probe, return the error code from the variable bochs, not dev. The
variable dev has not been initialized at this point. In the case of an
allocation error, the returned value would have been undefined.
Reported-by: Kees Bakker <kees@ijzerbout.nl>
Closes: https://lore.kernel.org/dri-devel/8c5bfc12-cbcc-4102-9826-494060df4179@ijzerbout.nl/
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 04826f588682 ("drm/bochs: Allocate DRM device in struct bochs_device")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux.dev
---
drivers/gpu/drm/tiny/bochs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
index 5d2d34976d4b..3ba7f09f3e7b 100644
--- a/drivers/gpu/drm/tiny/bochs.c
+++ b/drivers/gpu/drm/tiny/bochs.c
@@ -717,7 +717,7 @@ static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent
bochs = devm_drm_dev_alloc(&pdev->dev, &bochs_driver, struct bochs_device, dev);
if (IS_ERR(bochs))
- return PTR_ERR(dev);
+ return PTR_ERR(bochs);
dev = &bochs->dev;
ret = pcim_enable_device(pdev);
--
2.46.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] drm/bochs: Return error from correct pointer
2024-10-04 7:52 [PATCH] drm/bochs: Return error from correct pointer Thomas Zimmermann
@ 2024-10-04 8:13 ` Javier Martinez Canillas
0 siblings, 0 replies; 2+ messages in thread
From: Javier Martinez Canillas @ 2024-10-04 8:13 UTC (permalink / raw)
To: Thomas Zimmermann, kraxel, maarten.lankhorst, mripard, airlied,
simona
Cc: virtualization, dri-devel, Thomas Zimmermann, Kees Bakker
Thomas Zimmermann <tzimmermann@suse.de> writes:
Hello Thomas,
> In probe, return the error code from the variable bochs, not dev. The
> variable dev has not been initialized at this point. In the case of an
> allocation error, the returned value would have been undefined.
>
> Reported-by: Kees Bakker <kees@ijzerbout.nl>
> Closes: https://lore.kernel.org/dri-devel/8c5bfc12-cbcc-4102-9826-494060df4179@ijzerbout.nl/
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Fixes: 04826f588682 ("drm/bochs: Allocate DRM device in struct bochs_device")
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: virtualization@lists.linux.dev
> ---
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-04 8:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 7:52 [PATCH] drm/bochs: Return error from correct pointer Thomas Zimmermann
2024-10-04 8:13 ` Javier Martinez Canillas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox