patch-2.3.18 linux/drivers/atm/eni.c

Next file: linux/drivers/atm/horizon.c
Previous file: linux/drivers/atm/atmtcp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.17/linux/drivers/atm/eni.c linux/drivers/atm/eni.c
@@ -522,11 +522,7 @@
 	else {
 		length = ATM_CELL_SIZE-1; /* no HEC */
 	}
-	if (!length || !atm_charge(vcc,atm_pdu2truesize(length))) skb = NULL;
-	else {
-		skb = alloc_skb(length,GFP_ATOMIC);
-		if (!skb) atm_return(vcc,atm_pdu2truesize(length));
-	}
+	skb = length ? atm_alloc_charge(vcc,length,GFP_ATOMIC) : NULL;
 	if (!skb) {
 		discard(vcc,length >> 2);
 		return 0;
@@ -596,16 +592,7 @@
 			vcc->stats->rx_err++;
 		}
 	}
-	if (!eff || !atm_charge(vcc,atm_pdu2truesize(eff << 2))) skb = NULL;
-	else {
-		skb = alloc_skb(eff << 2,GFP_ATOMIC);
-		if (!skb) {
-			EVENT("peek reject (eff << 2=%ld)\n",eff << 2,0);
-			DPRINTK(DEV_LABEL "(itf %d): peek reject for %ld "
-			    "bytes\n",vcc->dev->number,eff << 2);
-			atm_return(vcc,atm_pdu2truesize(eff << 2));
-		}
-	}
+	skb = eff ? atm_alloc_charge(vcc,eff << 2,GFP_ATOMIC) : NULL;
 	if (!skb) {
 		discard(vcc,size);
 		return 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)