Re: [PATCH v3 net-next 08/21] net: usb: aqc111: Implement TX data path

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

 



From: Igor Russkikh <Igor.Russkikh@xxxxxxxxxxxx>
Date: Wed, 21 Nov 2018 10:13:37 +0000

> +	if (padding_size != 0)
> +		skb_put(skb, padding_size);

I think you want to use skb_put_zero() here rather than leaving it
uninitialized.  I know it's padding, but if for some reason this leaks
onto the wire or elsewhere we'll regret not initializing this buffer.

> +	/* Copy TX header */
> +	skb_push(skb, sizeof(tx_desc));
> +	cpu_to_le64s(&tx_desc);
> +	skb_copy_to_linear_data(skb, &tx_desc, sizeof(tx_desc));

I seriously wonder if, with all of the invariants wrt. length modulus
and padding, that you can safely just go:

	__le64 *p;

	p = skb_push(skb, sizeof(tx_desc));
	*p = cpu_to_le64(tx_desc);

or something like that.
	



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux