summaryrefslogtreecommitdiff
path: root/drivers/staging/sm7xxfb
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-08-26 11:57:16 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-04 14:23:33 -0700
commitd328ddd20e076e940f4931cd032aedf1ae2ced73 (patch)
treefd6ea65194692d8b8141629f63d5c720b61f4f87 /drivers/staging/sm7xxfb
parent147cd165757fc67fdf8ae58b015f39c8134970fb (diff)
staging: sm7xxfb: copy device name before we pass to the smtc_alloc_fb_info
the name is not initialised and passed to the function smtc_alloc_fb_info and copies the name into a member of fb structure. copy the name before calling alloc_fb_info. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Acked-by: Javier Muñoz <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm7xxfb')
-rw-r--r--drivers/staging/sm7xxfb/sm7xxfb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
index 1c1780c70fbb..d935c23456e8 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -798,6 +798,8 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
if (err)
return err;
+ sprintf(name, "sm%Xfb", ent->device);
+
sfb = smtc_alloc_fb_info(pdev, name);
if (!sfb) {
@@ -806,7 +808,6 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
}
sfb->chip_id = ent->device;
- sprintf(name, "sm%Xfb", sfb->chip_id);
pci_set_drvdata(pdev, sfb);