sh_eth: Fix skb alloc size and alignment adjust rule.
In the current driver, allocation size of skb does not care the alignment adjust after allocation. And also, in the current implementation, buffer alignment method by sh_eth_set_receive_align function has a bug that this function displace buffer start address forcedly when the alignment is corrected. In the result, tail of the skb will exceed allocated area and kernel panic will be occurred. This patch fix this issue. Signed-off-by: Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e0ebde0e13
commit
4d6a949c62
@@ -162,9 +162,9 @@ enum {
|
||||
|
||||
/* Driver's parameters */
|
||||
#if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
|
||||
#define SH4_SKB_RX_ALIGN 32
|
||||
#define SH_ETH_RX_ALIGN 32
|
||||
#else
|
||||
#define SH2_SH3_SKB_RX_ALIGN 2
|
||||
#define SH_ETH_RX_ALIGN 2
|
||||
#endif
|
||||
|
||||
/* Register's bits
|
||||
|
Reference in New Issue
Block a user