File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,12 @@ static struct sk_buff *ksz8795_xmit(struct sk_buff *skb, struct net_device *dev)
140
140
141
141
static struct sk_buff * ksz8795_rcv (struct sk_buff * skb , struct net_device * dev )
142
142
{
143
- u8 * tag = skb_tail_pointer (skb ) - KSZ_EGRESS_TAG_LEN ;
143
+ u8 * tag ;
144
+
145
+ if (skb_linearize (skb ))
146
+ return NULL ;
147
+
148
+ tag = skb_tail_pointer (skb ) - KSZ_EGRESS_TAG_LEN ;
144
149
145
150
return ksz_common_rcv (skb , dev , tag [0 ] & KSZ8795_TAIL_TAG_EG_PORT_M ,
146
151
KSZ_EGRESS_TAG_LEN );
@@ -311,10 +316,16 @@ static struct sk_buff *ksz9477_xmit(struct sk_buff *skb,
311
316
312
317
static struct sk_buff * ksz9477_rcv (struct sk_buff * skb , struct net_device * dev )
313
318
{
314
- /* Tag decoding */
315
- u8 * tag = skb_tail_pointer (skb ) - KSZ_EGRESS_TAG_LEN ;
316
- unsigned int port = tag [0 ] & KSZ9477_TAIL_TAG_EG_PORT_M ;
317
319
unsigned int len = KSZ_EGRESS_TAG_LEN ;
320
+ unsigned int port ;
321
+ u8 * tag ;
322
+
323
+ if (skb_linearize (skb ))
324
+ return NULL ;
325
+
326
+ /* Tag decoding */
327
+ tag = skb_tail_pointer (skb ) - KSZ_EGRESS_TAG_LEN ;
328
+ port = tag [0 ] & KSZ9477_TAIL_TAG_EG_PORT_M ;
318
329
319
330
/* Extra 4-bytes PTP timestamp */
320
331
if (tag [0 ] & KSZ9477_PTP_TAG_INDICATION ) {
You can’t perform that action at this time.
0 commit comments