Re: [PATCH 3/8] Staging: bcm: Remove typedef for _stLocalSFAddIndication and call directly.

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

 



On Sat, Sep 22, 2012 at 01:24:34AM -0400, Kevin McKinney wrote:
> diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
> index fd2780d..83c525c 100644
> --- a/drivers/staging/bcm/CmHost.c
> +++ b/drivers/staging/bcm/CmHost.c
> @@ -1334,7 +1334,7 @@ static ULONG StoreSFParam(struct bcm_mini_adapter *Adapter, PUCHAR pucSrcBuffer,
>  ULONG StoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter, PVOID pvBuffer, UINT *puBufferLength)
>  {
>  	stLocalSFAddIndicationAlt *pstAddIndicationAlt = NULL;
> -	stLocalSFAddIndication *pstAddIndication = NULL;
> +	struct bcm_add_indication *pstAddIndication = NULL;
>  	struct bcm_del_request *pstDeletionRequest;
>  	UINT uiSearchRuleIndex;
>  	ULONG ulSFID;
> @@ -1365,7 +1365,7 @@ ULONG StoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter, PVOID pvBu
>  	}
>  	/* For DSA_REQ, only up to "psfAuthorizedSet" parameter should be accessed by driver! */
>  
> -	pstAddIndication = kmalloc(sizeof(*pstAddIndication), GFP_KERNEL);
> +	pstAddIndication = kmalloc(sizeof(struct bcm_add_indication **), GFP_KERNEL);

This isn't right.  It should allocation the size of the struct
instead of the size of a pointer.

The original style is better as well.  The advantage is that if you
change the type of the pointer, then the allocation is still
correct.

>  	if (pstAddIndication == NULL)
>  		return 0;
>  

regards,
dan carpenter

_______________________________________________
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