Re: [PATCH] staging: sm7xxfb: copy device name before we pass to the smtc_alloc_fb_info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, there is a bug here. Thanks!

Acked-by: Javier Muñoz <jmunhoz@xxxxxxxxxx>

On 08/26/2012 08:27 AM, Devendra Naga wrote:
> 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@xxxxxxxxx>
> ---
>  drivers/staging/sm7xxfb/sm7xxfb.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
> index 1c1780c..d935c23 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);
>  

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux