summaryrefslogtreecommitdiff
path: root/drivers/staging/sm7xxfb
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-07-10 11:19:15 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-11 17:26:01 -0700
commitfd67859d380b4c2af160d4aa3d8041bf63d7bd36 (patch)
tree39c4d08a3b65a972c0508203b56056c975a20be0 /drivers/staging/sm7xxfb
parente6345c81b4eb20850ae4078ed3a8ff6eae584283 (diff)
staging/sm7xxfb: return a proper err for smtc_alloc_fb_info failure
as smtc_alloc_fb_info can fail, but we are returning the 0, how? because the pci_enable_device succeeded, which makes the probe return 0, and may cause panics or some strange problems at remove when driver unloaded by modprobe -r. so return err properly as smtc_alloc_fb_info is doing kzallocs its good to do -ENOMEM Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm7xxfb')
-rw-r--r--drivers/staging/sm7xxfb/sm7xxfb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
index 0c0b6035cb04..73951963c018 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -808,8 +808,10 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
sfb = smtc_alloc_fb_info(pdev, name);
- if (!sfb)
+ if (!sfb) {
+ err = -ENOMEM;
goto failed_free;
+ }
sfb->chip_id = ent->device;
sprintf(name, "sm%Xfb", sfb->chip_id);