[PATCH RESEND] staging: sm7xxfb: copy name of the device before calling smtc_alloc_fb_info

Devendra Naga develkernel412222 at gmail.com
Tue Aug 14 16:39:30 UTC 2012


Please ignore this patch, sorry i screwed again, i will try with care!



On Tue, Aug 14, 2012 at 10:22 PM, Devendra Naga
<develkernel412222 at gmail.com> wrote:
> as we do a strcpy(smdrv_ptr->fb_struct->fix->id, name), and the name here in
> sm7xxx_probe is not having any assignment, and which leads to copying of the garbage value
> into the id field of the fix struct of fb interface struct. fix it by copying the name before
> calling alloc_fbinfo
>
> Signed-off-by: Devendra Naga <develkernel412222 at gmail.com>
> ---
>  drivers/staging/sm7xxfb/sm7xxfb.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
> index 1c1780c..d3957ef 100644
> --- a/drivers/staging/sm7xxfb/sm7xxfb.c
> +++ b/drivers/staging/sm7xxfb/sm7xxfb.c
> @@ -798,16 +798,17 @@ 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);
>
> +       sfb->chip_id = ent->device;
> +
>         if (!sfb) {
>                 err = -ENOMEM;
>                 goto failed_free;
>         }
>
> -       sfb->chip_id = ent->device;
> -       sprintf(name, "sm%Xfb", sfb->chip_id);
> -
>         pci_set_drvdata(pdev, sfb);
>
>         sm7xx_init_hw();
> --
> 1.7.12.rc2
>



More information about the devel mailing list