Skip to content

Commit ed2ab35

Browse files
arndbdanvet
authored andcommitted
vgaarb: use valid dev pointer in vgaarb_info()
We now pass the device to the debug messages, but on non-x86, this is an invalid pointer in vga_arb_device_init: drivers/gpu/vga/vgaarb.c: In function 'vga_arb_device_init': drivers/gpu/vga/vgaarb.c:1467:4: error: 'dev' may be used uninitialized in this function [-Werror=maybe-uninitialized] This moves the initialization of the dev pointer outside of the architecture #ifdef. Fixes: a75d68f ("vgaarb: Use dev_printk() when possible") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161122143445.1896558-1-arnd@arndb.de
1 parent 1ea0c02 commit ed2ab35

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/gpu/vga/vgaarb.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,6 @@ static int __init vga_arb_device_init(void)
14071407
int rc;
14081408
struct pci_dev *pdev;
14091409
struct vga_device *vgadev;
1410-
struct device *dev;
14111410

14121411
rc = misc_register(&vga_arb_device);
14131412
if (rc < 0)
@@ -1424,6 +1423,7 @@ static int __init vga_arb_device_init(void)
14241423
vga_arbiter_add_pci_device(pdev);
14251424

14261425
list_for_each_entry(vgadev, &vga_list, list) {
1426+
struct device *dev = &vgadev->pdev->dev;
14271427
#if defined(CONFIG_X86) || defined(CONFIG_IA64)
14281428
/*
14291429
* Override vga_arbiter_add_pci_device()'s I/O based detection
@@ -1438,7 +1438,6 @@ static int __init vga_arb_device_init(void)
14381438
int i;
14391439

14401440
limit = screen_info.lfb_base + screen_info.lfb_size;
1441-
dev = &vgadev->pdev->dev;
14421441

14431442
/* Does firmware framebuffer belong to us? */
14441443
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {

0 commit comments

Comments
 (0)