Skip to content

Commit

Permalink
staging: sm7xxfb: copy device name before we pass to the smtc_alloc_f…
Browse files Browse the repository at this point in the history
…b_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 <[email protected]>
Acked-by: Javier Muñoz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Devendra Naga authored and gregkh committed Sep 4, 2012
1 parent 147cd16 commit d328ddd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/sm7xxfb/sm7xxfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);

Expand Down

0 comments on commit d328ddd

Please sign in to comment.