Search Linux Wireless

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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux