Driver should call disable_pci_device() if it returns from pci_probe()
with error.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
"Silicon Motion display driver " SMTC_LINUX_FB_VERSION "\n");
err = pci_enable_device(pdev); /* enable SMTC chip */
-
if (err)
return err;
err = -ENOMEM;
sfb = smtc_alloc_fb_info(pdev, name);
if (!sfb)
- goto failed;
+ goto failed_free;
/* Jason (08/13/2009)
* Store fb_info to be further used when suspending and resuming
*/
printk(KERN_INFO
"%s: unable to map memory mapped IO\n",
sfb->fb.fix.id);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto failed_fb;
}
/* set MCLK = 14.31818 * (0x16 / 0x2) */
printk(KERN_INFO
"No valid Silicon Motion display chip was detected!\n");
- smtc_free_fb_info(sfb);
- return err;
+ goto failed_fb;
}
/* can support 32 bpp */
smtc_unmap_smem(sfb);
smtc_unmap_mmio(sfb);
+failed_fb:
smtc_free_fb_info(sfb);
+failed_free:
+ pci_disable_device(pdev);
+
return err;
}