skb = dev_alloc_skb(len + 2);
if (!skb) {
- pr_err("Out of mem, dropping pkts\n");
/* Update statistics */
kni->stats.rx_dropped++;
continue;
kni->va[i] = pa2va(kni->pa[i], kva);
skb = dev_alloc_skb(len + 2);
- if (skb == NULL)
- pr_err("Out of mem, dropping pkts\n");
- else {
+ if (skb) {
/* Align IP on 16B boundary */
skb_reserve(skb, 2);
memcpy(skb_put(skb, len), data_kva, len);
/* Simulate real usage, allocate/copy skb twice */
skb = dev_alloc_skb(len + 2);
if (skb == NULL) {
- pr_err("Out of mem, dropping pkts\n");
kni->stats.rx_dropped++;
continue;
}