Re: [PATCH 40/40] staging: wilc1000: fixes comparison to NULL could be written

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

 



On Thu, Oct 15, 2015 at 01:25:21PM +0900, Tony Cho wrote:
> @@ -2306,7 +2303,8 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
>  	strWID.type = WID_BIN;
>  	strWID.size = pstrSetBeaconParam->head_len + pstrSetBeaconParam->tail_len + 16;
>  	strWID.val = kmalloc(strWID.size, GFP_KERNEL);
> -	if (strWID.val == NULL)
> +
> +	if (!strWID.val)
>  		goto ERRORHANDLER;
>  
>  	pu8CurrByte = strWID.val;

This patch is fine, but an unrelated comment is that, in wilc1000 the
pattern is to put a blank line between the allocation and the error
check but that's the wrong thing.  The allocation and the check are part
of the same step and they should go next to each other.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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