[LLC]: Fix the accept path
[linux-3.10.git] / net / llc / llc_station.c
index 2d764b0382ce27348291f40094220caef605db83..f37dbf8ef126a1cdc8464d98f1320660f664a9f6 100644 (file)
@@ -254,14 +254,14 @@ static int llc_station_ac_inc_xid_r_cnt_by_1(struct sk_buff *skb)
 static int llc_station_ac_send_null_dsap_xid_c(struct sk_buff *skb)
 {
        int rc = 1;
-       struct sk_buff *nskb = llc_alloc_frame(skb->dev);
+       struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev);
 
        if (!nskb)
                goto out;
        llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD);
        llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127);
        rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, llc_station_mac_sa);
-       if (rc)
+       if (unlikely(rc))
                goto free;
        llc_station_send_pdu(nskb);
 out:
@@ -275,7 +275,7 @@ static int llc_station_ac_send_xid_r(struct sk_buff *skb)
 {
        u8 mac_da[ETH_ALEN], dsap;
        int rc = 1;
-       struct sk_buff* nskb = llc_alloc_frame(skb->dev);
+       struct sk_buff* nskb = llc_alloc_frame(NULL, skb->dev);
 
        if (!nskb)
                goto out;
@@ -285,7 +285,7 @@ static int llc_station_ac_send_xid_r(struct sk_buff *skb)
        llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP);
        llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127);
        rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da);
-       if (rc)
+       if (unlikely(rc))
                goto free;
        llc_station_send_pdu(nskb);
 out:
@@ -299,7 +299,7 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb)
 {
        u8 mac_da[ETH_ALEN], dsap;
        int rc = 1;
-       struct sk_buff *nskb = llc_alloc_frame(skb->dev);
+       struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev);
 
        if (!nskb)
                goto out;
@@ -309,7 +309,7 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb)
        llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP);
                llc_pdu_init_as_test_rsp(nskb, skb);
        rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da);
-       if (rc)
+       if (unlikely(rc))
                goto free;
        llc_station_send_pdu(nskb);
 out: