Commit bb292234 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: xgifb_probe() error paths missing framebuffer_release()

framebuffer_release() is missing from error paths.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent decebabf
...@@ -2935,6 +2935,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -2935,6 +2935,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
u16 reg16; u16 reg16;
u8 reg, reg1; u8 reg, reg1;
u8 CR48, CR38; u8 CR48, CR38;
int ret;
if (XGIfb_off) if (XGIfb_off)
return -ENXIO; return -ENXIO;
...@@ -2966,8 +2968,10 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -2966,8 +2968,10 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
printk("XGIfb: Relocate IO address: %lx [%08lx]\n", printk("XGIfb: Relocate IO address: %lx [%08lx]\n",
(unsigned long)pci_resource_start(pdev, 2), XGI_Pr.RelIO); (unsigned long)pci_resource_start(pdev, 2), XGI_Pr.RelIO);
if (pci_enable_device(pdev)) if (pci_enable_device(pdev)) {
return -EIO; ret = -EIO;
goto error;
}
XGIRegInit(&XGI_Pr, (unsigned long)XGIhw_ext.pjIOAddress); XGIRegInit(&XGI_Pr, (unsigned long)XGIhw_ext.pjIOAddress);
...@@ -2976,7 +2980,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -2976,7 +2980,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
if (reg1 != 0xa1) { /*I/O error */ if (reg1 != 0xa1) { /*I/O error */
printk("\nXGIfb: I/O error!!!"); printk("\nXGIfb: I/O error!!!");
return -EIO; ret = -EIO;
goto error;
} }
switch (xgi_video_info.chip_id) { switch (xgi_video_info.chip_id) {
...@@ -3011,7 +3016,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -3011,7 +3016,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
XGIfb_CRT2_write_enable = IND_XGI_CRT2_WRITE_ENABLE_315; XGIfb_CRT2_write_enable = IND_XGI_CRT2_WRITE_ENABLE_315;
break; break;
default: default:
return -ENODEV; ret = -ENODEV;
goto error;
} }
printk("XGIfb:chipid = %x\n", xgi_video_info.chip); printk("XGIfb:chipid = %x\n", xgi_video_info.chip);
...@@ -3052,7 +3058,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -3052,7 +3058,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
XGIhw_ext.pSR = vmalloc(sizeof(struct XGI_DSReg) * SR_BUFFER_SIZE); XGIhw_ext.pSR = vmalloc(sizeof(struct XGI_DSReg) * SR_BUFFER_SIZE);
if (XGIhw_ext.pSR == NULL) { if (XGIhw_ext.pSR == NULL) {
printk(KERN_ERR "XGIfb: Fatal error: Allocating SRReg space failed.\n"); printk(KERN_ERR "XGIfb: Fatal error: Allocating SRReg space failed.\n");
return -ENODEV; ret = -ENODEV;
goto error;
} }
XGIhw_ext.pSR[0].jIdx = XGIhw_ext.pSR[0].jVal = 0xFF; XGIhw_ext.pSR[0].jIdx = XGIhw_ext.pSR[0].jVal = 0xFF;
...@@ -3060,7 +3067,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -3060,7 +3067,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
if (XGIhw_ext.pCR == NULL) { if (XGIhw_ext.pCR == NULL) {
vfree(XGIhw_ext.pSR); vfree(XGIhw_ext.pSR);
printk(KERN_ERR "XGIfb: Fatal error: Allocating CRReg space failed.\n"); printk(KERN_ERR "XGIfb: Fatal error: Allocating CRReg space failed.\n");
return -ENODEV; ret = -ENODEV;
goto error;
} }
XGIhw_ext.pCR[0].jIdx = XGIhw_ext.pCR[0].jVal = 0xFF; XGIhw_ext.pCR[0].jIdx = XGIhw_ext.pCR[0].jVal = 0xFF;
...@@ -3100,7 +3108,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -3100,7 +3108,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
vfree(XGIhw_ext.pSR); vfree(XGIhw_ext.pSR);
vfree(XGIhw_ext.pCR); vfree(XGIhw_ext.pCR);
printk(KERN_INFO "XGIfb: Fatal error: Unable to determine RAM size.\n"); printk(KERN_INFO "XGIfb: Fatal error: Unable to determine RAM size.\n");
return -ENODEV; ret = -ENODEV;
goto error;
} }
if ((xgifb_mode_idx < 0) || ((XGIbios_mode[xgifb_mode_idx].mode_no) != 0xFF)) { if ((xgifb_mode_idx < 0) || ((XGIbios_mode[xgifb_mode_idx].mode_no) != 0xFF)) {
...@@ -3118,7 +3127,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -3118,7 +3127,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
printk(KERN_ERR "XGIfb: Is there another framebuffer driver active?\n"); printk(KERN_ERR "XGIfb: Is there another framebuffer driver active?\n");
vfree(XGIhw_ext.pSR); vfree(XGIhw_ext.pSR);
vfree(XGIhw_ext.pCR); vfree(XGIhw_ext.pCR);
return -ENODEV; ret = -ENODEV;
goto error;
} }
if (!request_mem_region(xgi_video_info.mmio_base, XGIfb_mmio_size, "XGIfb MMIO")) { if (!request_mem_region(xgi_video_info.mmio_base, XGIfb_mmio_size, "XGIfb MMIO")) {
...@@ -3126,7 +3136,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -3126,7 +3136,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
release_mem_region(xgi_video_info.video_base, xgi_video_info.video_size); release_mem_region(xgi_video_info.video_base, xgi_video_info.video_size);
vfree(XGIhw_ext.pSR); vfree(XGIhw_ext.pSR);
vfree(XGIhw_ext.pCR); vfree(XGIhw_ext.pCR);
return -ENODEV; ret = -ENODEV;
goto error;
} }
xgi_video_info.video_vbase = XGIhw_ext.pjVideoMemoryAddress = xgi_video_info.video_vbase = XGIhw_ext.pjVideoMemoryAddress =
...@@ -3413,8 +3424,10 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -3413,8 +3424,10 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
printk(KERN_INFO "XGIfb: Added MTRRs\n"); printk(KERN_INFO "XGIfb: Added MTRRs\n");
#endif #endif
if (register_framebuffer(fb_info) < 0) if (register_framebuffer(fb_info) < 0) {
return -EINVAL; ret = -EINVAL;
goto error;
}
XGIfb_registered = 1; XGIfb_registered = 1;
...@@ -3426,6 +3439,10 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -3426,6 +3439,10 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
dumpVGAReg(); dumpVGAReg();
return 0; return 0;
error:
framebuffer_release(fb_info);
return ret;
} }
/*****************************************************/ /*****************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment