Skip to content

Commit 2d6d8b1

Browse files
author
Thomas Zimmermann
committed
drm/bochs: Return error from correct pointer
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 <[email protected]> Closes: https://lore.kernel.org/dri-devel/[email protected]/ Signed-off-by: Thomas Zimmermann <[email protected]> Fixes: 04826f5 ("drm/bochs: Allocate DRM device in struct bochs_device") Cc: Thomas Zimmermann <[email protected]> Cc: Gerd Hoffmann <[email protected]> Cc: [email protected] Reviewed-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 6b3815c commit 2d6d8b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/tiny/bochs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent
717717

718718
bochs = devm_drm_dev_alloc(&pdev->dev, &bochs_driver, struct bochs_device, dev);
719719
if (IS_ERR(bochs))
720-
return PTR_ERR(dev);
720+
return PTR_ERR(bochs);
721721
dev = &bochs->dev;
722722

723723
ret = pcim_enable_device(pdev);

0 commit comments

Comments
 (0)