diff options
-rw-r--r-- | net/llc/af_llc.c | 10 | ||||
-rw-r--r-- | net/llc/llc_c_ac.c | 52 | ||||
-rw-r--r-- | net/llc/llc_if.c | 9 | ||||
-rw-r--r-- | net/llc/llc_output.c | 2 | ||||
-rw-r--r-- | net/llc/llc_s_ac.c | 10 | ||||
-rw-r--r-- | net/llc/llc_station.c | 6 |
6 files changed, 42 insertions, 47 deletions
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index ef125345a2db..7e9cf3214b88 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
@@ -116,12 +116,12 @@ static int llc_ui_send_data(struct sock* sk, struct sk_buff *skb, int noblock) | |||
116 | struct llc_sock* llc = llc_sk(sk); | 116 | struct llc_sock* llc = llc_sk(sk); |
117 | int rc = 0; | 117 | int rc = 0; |
118 | 118 | ||
119 | if (llc_data_accept_state(llc->state) || llc->p_flag) { | 119 | if (unlikely(llc_data_accept_state(llc->state) || llc->p_flag)) { |
120 | long timeout = sock_sndtimeo(sk, noblock); | 120 | long timeout = sock_sndtimeo(sk, noblock); |
121 | 121 | ||
122 | rc = llc_ui_wait_for_busy_core(sk, timeout); | 122 | rc = llc_ui_wait_for_busy_core(sk, timeout); |
123 | } | 123 | } |
124 | if (!rc) | 124 | if (unlikely(!rc)) |
125 | rc = llc_build_and_send_pkt(sk, skb); | 125 | rc = llc_build_and_send_pkt(sk, skb); |
126 | return rc; | 126 | return rc; |
127 | } | 127 | } |
@@ -762,15 +762,13 @@ static int llc_ui_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
762 | if (!(sk->sk_type == SOCK_STREAM && !addr->sllc_ua)) | 762 | if (!(sk->sk_type == SOCK_STREAM && !addr->sllc_ua)) |
763 | goto out; | 763 | goto out; |
764 | rc = llc_ui_send_data(sk, skb, noblock); | 764 | rc = llc_ui_send_data(sk, skb, noblock); |
765 | if (rc) | ||
766 | dprintk("%s: llc_ui_send_data failed: %d\n", __FUNCTION__, rc); | ||
767 | out: | 765 | out: |
768 | if (rc) | 766 | if (rc) { |
769 | kfree_skb(skb); | 767 | kfree_skb(skb); |
770 | release: | 768 | release: |
771 | if (rc) | ||
772 | dprintk("%s: failed sending from %02X to %02X: %d\n", | 769 | dprintk("%s: failed sending from %02X to %02X: %d\n", |
773 | __FUNCTION__, llc->laddr.lsap, llc->daddr.lsap, rc); | 770 | __FUNCTION__, llc->laddr.lsap, llc->daddr.lsap, rc); |
771 | } | ||
774 | release_sock(sk); | 772 | release_sock(sk); |
775 | return rc ? : copied; | 773 | return rc ? : copied; |
776 | } | 774 | } |
diff --git a/net/llc/llc_c_ac.c b/net/llc/llc_c_ac.c index a4daa91003dd..9d9b6c8aeb44 100644 --- a/net/llc/llc_c_ac.c +++ b/net/llc/llc_c_ac.c | |||
@@ -221,7 +221,7 @@ int llc_conn_ac_send_disc_cmd_p_set_x(struct sock *sk, struct sk_buff *skb) | |||
221 | llc->daddr.lsap, LLC_PDU_CMD); | 221 | llc->daddr.lsap, LLC_PDU_CMD); |
222 | llc_pdu_init_as_disc_cmd(nskb, 1); | 222 | llc_pdu_init_as_disc_cmd(nskb, 1); |
223 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 223 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
224 | if (rc) | 224 | if (unlikely(rc)) |
225 | goto free; | 225 | goto free; |
226 | llc_conn_send_pdu(sk, nskb); | 226 | llc_conn_send_pdu(sk, nskb); |
227 | llc_conn_ac_set_p_flag_1(sk, skb); | 227 | llc_conn_ac_set_p_flag_1(sk, skb); |
@@ -248,7 +248,7 @@ int llc_conn_ac_send_dm_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) | |||
248 | llc->daddr.lsap, LLC_PDU_RSP); | 248 | llc->daddr.lsap, LLC_PDU_RSP); |
249 | llc_pdu_init_as_dm_rsp(nskb, f_bit); | 249 | llc_pdu_init_as_dm_rsp(nskb, f_bit); |
250 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 250 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
251 | if (rc) | 251 | if (unlikely(rc)) |
252 | goto free; | 252 | goto free; |
253 | llc_conn_send_pdu(sk, nskb); | 253 | llc_conn_send_pdu(sk, nskb); |
254 | } | 254 | } |
@@ -272,7 +272,7 @@ int llc_conn_ac_send_dm_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
272 | llc->daddr.lsap, LLC_PDU_RSP); | 272 | llc->daddr.lsap, LLC_PDU_RSP); |
273 | llc_pdu_init_as_dm_rsp(nskb, 1); | 273 | llc_pdu_init_as_dm_rsp(nskb, 1); |
274 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 274 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
275 | if (rc) | 275 | if (unlikely(rc)) |
276 | goto free; | 276 | goto free; |
277 | llc_conn_send_pdu(sk, nskb); | 277 | llc_conn_send_pdu(sk, nskb); |
278 | } | 278 | } |
@@ -305,7 +305,7 @@ int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk, struct sk_buff *skb) | |||
305 | llc_pdu_init_as_frmr_rsp(nskb, pdu, f_bit, llc->vS, | 305 | llc_pdu_init_as_frmr_rsp(nskb, pdu, f_bit, llc->vS, |
306 | llc->vR, INCORRECT); | 306 | llc->vR, INCORRECT); |
307 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 307 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
308 | if (rc) | 308 | if (unlikely(rc)) |
309 | goto free; | 309 | goto free; |
310 | llc_conn_send_pdu(sk, nskb); | 310 | llc_conn_send_pdu(sk, nskb); |
311 | } | 311 | } |
@@ -331,7 +331,7 @@ int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock *sk, struct sk_buff *skb) | |||
331 | llc_pdu_init_as_frmr_rsp(nskb, pdu, 0, llc->vS, | 331 | llc_pdu_init_as_frmr_rsp(nskb, pdu, 0, llc->vS, |
332 | llc->vR, INCORRECT); | 332 | llc->vR, INCORRECT); |
333 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 333 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
334 | if (rc) | 334 | if (unlikely(rc)) |
335 | goto free; | 335 | goto free; |
336 | llc_conn_send_pdu(sk, nskb); | 336 | llc_conn_send_pdu(sk, nskb); |
337 | } | 337 | } |
@@ -360,7 +360,7 @@ int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) | |||
360 | llc_pdu_init_as_frmr_rsp(nskb, pdu, f_bit, llc->vS, | 360 | llc_pdu_init_as_frmr_rsp(nskb, pdu, f_bit, llc->vS, |
361 | llc->vR, INCORRECT); | 361 | llc->vR, INCORRECT); |
362 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 362 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
363 | if (rc) | 363 | if (unlikely(rc)) |
364 | goto free; | 364 | goto free; |
365 | llc_conn_send_pdu(sk, nskb); | 365 | llc_conn_send_pdu(sk, nskb); |
366 | } | 366 | } |
@@ -381,7 +381,7 @@ int llc_conn_ac_send_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) | |||
381 | llc->daddr.lsap, LLC_PDU_CMD); | 381 | llc->daddr.lsap, LLC_PDU_CMD); |
382 | llc_pdu_init_as_i_cmd(skb, 1, llc->vS, llc->vR); | 382 | llc_pdu_init_as_i_cmd(skb, 1, llc->vS, llc->vR); |
383 | rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac); | 383 | rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac); |
384 | if (!rc) { | 384 | if (likely(!rc)) { |
385 | llc_conn_send_pdu(sk, skb); | 385 | llc_conn_send_pdu(sk, skb); |
386 | llc_conn_ac_inc_vs_by_1(sk, skb); | 386 | llc_conn_ac_inc_vs_by_1(sk, skb); |
387 | } | 387 | } |
@@ -398,7 +398,7 @@ static int llc_conn_ac_send_i_cmd_p_set_0(struct sock *sk, struct sk_buff *skb) | |||
398 | llc->daddr.lsap, LLC_PDU_CMD); | 398 | llc->daddr.lsap, LLC_PDU_CMD); |
399 | llc_pdu_init_as_i_cmd(skb, 0, llc->vS, llc->vR); | 399 | llc_pdu_init_as_i_cmd(skb, 0, llc->vS, llc->vR); |
400 | rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac); | 400 | rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac); |
401 | if (!rc) { | 401 | if (likely(!rc)) { |
402 | llc_conn_send_pdu(sk, skb); | 402 | llc_conn_send_pdu(sk, skb); |
403 | llc_conn_ac_inc_vs_by_1(sk, skb); | 403 | llc_conn_ac_inc_vs_by_1(sk, skb); |
404 | } | 404 | } |
@@ -415,7 +415,7 @@ int llc_conn_ac_send_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
415 | llc->daddr.lsap, LLC_PDU_CMD); | 415 | llc->daddr.lsap, LLC_PDU_CMD); |
416 | llc_pdu_init_as_i_cmd(skb, 0, llc->vS, llc->vR); | 416 | llc_pdu_init_as_i_cmd(skb, 0, llc->vS, llc->vR); |
417 | rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac); | 417 | rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac); |
418 | if (!rc) { | 418 | if (likely(!rc)) { |
419 | llc_conn_send_pdu(sk, skb); | 419 | llc_conn_send_pdu(sk, skb); |
420 | llc_conn_ac_inc_vs_by_1(sk, skb); | 420 | llc_conn_ac_inc_vs_by_1(sk, skb); |
421 | } | 421 | } |
@@ -447,7 +447,7 @@ int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk, | |||
447 | llc->daddr.lsap, LLC_PDU_RSP); | 447 | llc->daddr.lsap, LLC_PDU_RSP); |
448 | llc_pdu_init_as_rr_rsp(nskb, 0, llc->vR); | 448 | llc_pdu_init_as_rr_rsp(nskb, 0, llc->vR); |
449 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 449 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
450 | if (!rc) | 450 | if (likely(!rc)) |
451 | llc_conn_send_pdu(sk, nskb); | 451 | llc_conn_send_pdu(sk, nskb); |
452 | else | 452 | else |
453 | kfree_skb(skb); | 453 | kfree_skb(skb); |
@@ -482,7 +482,7 @@ int llc_conn_ac_send_rej_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) | |||
482 | llc->daddr.lsap, LLC_PDU_CMD); | 482 | llc->daddr.lsap, LLC_PDU_CMD); |
483 | llc_pdu_init_as_rej_cmd(nskb, 1, llc->vR); | 483 | llc_pdu_init_as_rej_cmd(nskb, 1, llc->vR); |
484 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 484 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
485 | if (rc) | 485 | if (unlikely(rc)) |
486 | goto free; | 486 | goto free; |
487 | llc_conn_send_pdu(sk, nskb); | 487 | llc_conn_send_pdu(sk, nskb); |
488 | } | 488 | } |
@@ -506,7 +506,7 @@ int llc_conn_ac_send_rej_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
506 | llc->daddr.lsap, LLC_PDU_RSP); | 506 | llc->daddr.lsap, LLC_PDU_RSP); |
507 | llc_pdu_init_as_rej_rsp(nskb, 1, llc->vR); | 507 | llc_pdu_init_as_rej_rsp(nskb, 1, llc->vR); |
508 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 508 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
509 | if (rc) | 509 | if (unlikely(rc)) |
510 | goto free; | 510 | goto free; |
511 | llc_conn_send_pdu(sk, nskb); | 511 | llc_conn_send_pdu(sk, nskb); |
512 | } | 512 | } |
@@ -530,7 +530,7 @@ int llc_conn_ac_send_rej_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
530 | llc->daddr.lsap, LLC_PDU_RSP); | 530 | llc->daddr.lsap, LLC_PDU_RSP); |
531 | llc_pdu_init_as_rej_rsp(nskb, 0, llc->vR); | 531 | llc_pdu_init_as_rej_rsp(nskb, 0, llc->vR); |
532 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 532 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
533 | if (rc) | 533 | if (unlikely(rc)) |
534 | goto free; | 534 | goto free; |
535 | llc_conn_send_pdu(sk, nskb); | 535 | llc_conn_send_pdu(sk, nskb); |
536 | } | 536 | } |
@@ -554,7 +554,7 @@ int llc_conn_ac_send_rnr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) | |||
554 | llc->daddr.lsap, LLC_PDU_CMD); | 554 | llc->daddr.lsap, LLC_PDU_CMD); |
555 | llc_pdu_init_as_rnr_cmd(nskb, 1, llc->vR); | 555 | llc_pdu_init_as_rnr_cmd(nskb, 1, llc->vR); |
556 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 556 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
557 | if (rc) | 557 | if (unlikely(rc)) |
558 | goto free; | 558 | goto free; |
559 | llc_conn_send_pdu(sk, nskb); | 559 | llc_conn_send_pdu(sk, nskb); |
560 | } | 560 | } |
@@ -578,7 +578,7 @@ int llc_conn_ac_send_rnr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
578 | llc->daddr.lsap, LLC_PDU_RSP); | 578 | llc->daddr.lsap, LLC_PDU_RSP); |
579 | llc_pdu_init_as_rnr_rsp(nskb, 1, llc->vR); | 579 | llc_pdu_init_as_rnr_rsp(nskb, 1, llc->vR); |
580 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 580 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
581 | if (rc) | 581 | if (unlikely(rc)) |
582 | goto free; | 582 | goto free; |
583 | llc_conn_send_pdu(sk, nskb); | 583 | llc_conn_send_pdu(sk, nskb); |
584 | } | 584 | } |
@@ -602,7 +602,7 @@ int llc_conn_ac_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
602 | llc->daddr.lsap, LLC_PDU_RSP); | 602 | llc->daddr.lsap, LLC_PDU_RSP); |
603 | llc_pdu_init_as_rnr_rsp(nskb, 0, llc->vR); | 603 | llc_pdu_init_as_rnr_rsp(nskb, 0, llc->vR); |
604 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 604 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
605 | if (rc) | 605 | if (unlikely(rc)) |
606 | goto free; | 606 | goto free; |
607 | llc_conn_send_pdu(sk, nskb); | 607 | llc_conn_send_pdu(sk, nskb); |
608 | } | 608 | } |
@@ -638,7 +638,7 @@ int llc_conn_ac_opt_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
638 | llc->daddr.lsap, LLC_PDU_RSP); | 638 | llc->daddr.lsap, LLC_PDU_RSP); |
639 | llc_pdu_init_as_rnr_rsp(nskb, 0, llc->vR); | 639 | llc_pdu_init_as_rnr_rsp(nskb, 0, llc->vR); |
640 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 640 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
641 | if (rc) | 641 | if (unlikely(rc)) |
642 | goto free; | 642 | goto free; |
643 | llc_conn_send_pdu(sk, nskb); | 643 | llc_conn_send_pdu(sk, nskb); |
644 | } | 644 | } |
@@ -662,7 +662,7 @@ int llc_conn_ac_send_rr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) | |||
662 | llc->daddr.lsap, LLC_PDU_CMD); | 662 | llc->daddr.lsap, LLC_PDU_CMD); |
663 | llc_pdu_init_as_rr_cmd(nskb, 1, llc->vR); | 663 | llc_pdu_init_as_rr_cmd(nskb, 1, llc->vR); |
664 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 664 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
665 | if (rc) | 665 | if (unlikely(rc)) |
666 | goto free; | 666 | goto free; |
667 | llc_conn_send_pdu(sk, nskb); | 667 | llc_conn_send_pdu(sk, nskb); |
668 | } | 668 | } |
@@ -687,7 +687,7 @@ int llc_conn_ac_send_rr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
687 | llc->daddr.lsap, LLC_PDU_RSP); | 687 | llc->daddr.lsap, LLC_PDU_RSP); |
688 | llc_pdu_init_as_rr_rsp(nskb, f_bit, llc->vR); | 688 | llc_pdu_init_as_rr_rsp(nskb, f_bit, llc->vR); |
689 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 689 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
690 | if (rc) | 690 | if (unlikely(rc)) |
691 | goto free; | 691 | goto free; |
692 | llc_conn_send_pdu(sk, nskb); | 692 | llc_conn_send_pdu(sk, nskb); |
693 | } | 693 | } |
@@ -711,7 +711,7 @@ int llc_conn_ac_send_ack_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
711 | llc->daddr.lsap, LLC_PDU_RSP); | 711 | llc->daddr.lsap, LLC_PDU_RSP); |
712 | llc_pdu_init_as_rr_rsp(nskb, 1, llc->vR); | 712 | llc_pdu_init_as_rr_rsp(nskb, 1, llc->vR); |
713 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 713 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
714 | if (rc) | 714 | if (unlikely(rc)) |
715 | goto free; | 715 | goto free; |
716 | llc_conn_send_pdu(sk, nskb); | 716 | llc_conn_send_pdu(sk, nskb); |
717 | } | 717 | } |
@@ -735,7 +735,7 @@ int llc_conn_ac_send_rr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
735 | llc->daddr.lsap, LLC_PDU_RSP); | 735 | llc->daddr.lsap, LLC_PDU_RSP); |
736 | llc_pdu_init_as_rr_rsp(nskb, 0, llc->vR); | 736 | llc_pdu_init_as_rr_rsp(nskb, 0, llc->vR); |
737 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 737 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
738 | if (rc) | 738 | if (unlikely(rc)) |
739 | goto free; | 739 | goto free; |
740 | llc_conn_send_pdu(sk, nskb); | 740 | llc_conn_send_pdu(sk, nskb); |
741 | } | 741 | } |
@@ -759,7 +759,7 @@ int llc_conn_ac_send_ack_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
759 | llc->daddr.lsap, LLC_PDU_RSP); | 759 | llc->daddr.lsap, LLC_PDU_RSP); |
760 | llc_pdu_init_as_rr_rsp(nskb, 0, llc->vR); | 760 | llc_pdu_init_as_rr_rsp(nskb, 0, llc->vR); |
761 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 761 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
762 | if (rc) | 762 | if (unlikely(rc)) |
763 | goto free; | 763 | goto free; |
764 | llc_conn_send_pdu(sk, nskb); | 764 | llc_conn_send_pdu(sk, nskb); |
765 | } | 765 | } |
@@ -796,7 +796,7 @@ int llc_conn_ac_send_sabme_cmd_p_set_x(struct sock *sk, struct sk_buff *skb) | |||
796 | llc->daddr.lsap, LLC_PDU_CMD); | 796 | llc->daddr.lsap, LLC_PDU_CMD); |
797 | llc_pdu_init_as_sabme_cmd(nskb, 1); | 797 | llc_pdu_init_as_sabme_cmd(nskb, 1); |
798 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, dmac); | 798 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, dmac); |
799 | if (rc) | 799 | if (unlikely(rc)) |
800 | goto free; | 800 | goto free; |
801 | llc_conn_send_pdu(sk, nskb); | 801 | llc_conn_send_pdu(sk, nskb); |
802 | llc_conn_set_p_flag(sk, 1); | 802 | llc_conn_set_p_flag(sk, 1); |
@@ -824,7 +824,7 @@ int llc_conn_ac_send_ua_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) | |||
824 | llc->daddr.lsap, LLC_PDU_RSP); | 824 | llc->daddr.lsap, LLC_PDU_RSP); |
825 | llc_pdu_init_as_ua_rsp(nskb, f_bit); | 825 | llc_pdu_init_as_ua_rsp(nskb, f_bit); |
826 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 826 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
827 | if (rc) | 827 | if (unlikely(rc)) |
828 | goto free; | 828 | goto free; |
829 | llc_conn_send_pdu(sk, nskb); | 829 | llc_conn_send_pdu(sk, nskb); |
830 | } | 830 | } |
@@ -924,7 +924,7 @@ static int llc_conn_ac_send_i_rsp_f_set_ackpf(struct sock *sk, | |||
924 | llc->daddr.lsap, LLC_PDU_RSP); | 924 | llc->daddr.lsap, LLC_PDU_RSP); |
925 | llc_pdu_init_as_i_cmd(skb, llc->ack_pf, llc->vS, llc->vR); | 925 | llc_pdu_init_as_i_cmd(skb, llc->ack_pf, llc->vS, llc->vR); |
926 | rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac); | 926 | rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac); |
927 | if (!rc) { | 927 | if (likely(!rc)) { |
928 | llc_conn_send_pdu(sk, skb); | 928 | llc_conn_send_pdu(sk, skb); |
929 | llc_conn_ac_inc_vs_by_1(sk, skb); | 929 | llc_conn_ac_inc_vs_by_1(sk, skb); |
930 | } | 930 | } |
@@ -978,7 +978,7 @@ static int llc_conn_ac_send_rr_rsp_f_set_ackpf(struct sock *sk, | |||
978 | llc->daddr.lsap, LLC_PDU_RSP); | 978 | llc->daddr.lsap, LLC_PDU_RSP); |
979 | llc_pdu_init_as_rr_rsp(nskb, llc->ack_pf, llc->vR); | 979 | llc_pdu_init_as_rr_rsp(nskb, llc->ack_pf, llc->vR); |
980 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); | 980 | rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); |
981 | if (rc) | 981 | if (unlikely(rc)) |
982 | goto free; | 982 | goto free; |
983 | llc_conn_send_pdu(sk, nskb); | 983 | llc_conn_send_pdu(sk, nskb); |
984 | } | 984 | } |
diff --git a/net/llc/llc_if.c b/net/llc/llc_if.c index 0f84f66018e4..764dbd704051 100644 --- a/net/llc/llc_if.c +++ b/net/llc/llc_if.c | |||
@@ -47,14 +47,11 @@ int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb) | |||
47 | int rc = -ECONNABORTED; | 47 | int rc = -ECONNABORTED; |
48 | struct llc_sock *llc = llc_sk(sk); | 48 | struct llc_sock *llc = llc_sk(sk); |
49 | 49 | ||
50 | if (llc->state == LLC_CONN_STATE_ADM) | 50 | if (unlikely(llc->state == LLC_CONN_STATE_ADM)) |
51 | goto out; | 51 | goto out; |
52 | rc = -EBUSY; | 52 | rc = -EBUSY; |
53 | if (llc_data_accept_state(llc->state)) { /* data_conn_refuse */ | 53 | if (unlikely(llc_data_accept_state(llc->state) || /* data_conn_refuse */ |
54 | llc->failed_data_req = 1; | 54 | llc->p_flag)) { |
55 | goto out; | ||
56 | } | ||
57 | if (llc->p_flag) { | ||
58 | llc->failed_data_req = 1; | 55 | llc->failed_data_req = 1; |
59 | goto out; | 56 | goto out; |
60 | } | 57 | } |
diff --git a/net/llc/llc_output.c b/net/llc/llc_output.c index ab5784cf163e..b4d55b6abb67 100644 --- a/net/llc/llc_output.c +++ b/net/llc/llc_output.c | |||
@@ -98,7 +98,7 @@ int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb, | |||
98 | dsap, LLC_PDU_CMD); | 98 | dsap, LLC_PDU_CMD); |
99 | llc_pdu_init_as_ui_cmd(skb); | 99 | llc_pdu_init_as_ui_cmd(skb); |
100 | rc = llc_mac_hdr_init(skb, skb->dev->dev_addr, dmac); | 100 | rc = llc_mac_hdr_init(skb, skb->dev->dev_addr, dmac); |
101 | if (!rc) | 101 | if (likely(!rc)) |
102 | rc = dev_queue_xmit(skb); | 102 | rc = dev_queue_xmit(skb); |
103 | return rc; | 103 | return rc; |
104 | } | 104 | } |
diff --git a/net/llc/llc_s_ac.c b/net/llc/llc_s_ac.c index 270b2f2030cd..6acdebf03b2b 100644 --- a/net/llc/llc_s_ac.c +++ b/net/llc/llc_s_ac.c | |||
@@ -58,7 +58,7 @@ int llc_sap_action_send_ui(struct llc_sap *sap, struct sk_buff *skb) | |||
58 | ev->daddr.lsap, LLC_PDU_CMD); | 58 | ev->daddr.lsap, LLC_PDU_CMD); |
59 | llc_pdu_init_as_ui_cmd(skb); | 59 | llc_pdu_init_as_ui_cmd(skb); |
60 | rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac); | 60 | rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac); |
61 | if (!rc) | 61 | if (likely(!rc)) |
62 | rc = dev_queue_xmit(skb); | 62 | rc = dev_queue_xmit(skb); |
63 | return rc; | 63 | return rc; |
64 | } | 64 | } |
@@ -81,7 +81,7 @@ int llc_sap_action_send_xid_c(struct llc_sap *sap, struct sk_buff *skb) | |||
81 | ev->daddr.lsap, LLC_PDU_CMD); | 81 | ev->daddr.lsap, LLC_PDU_CMD); |
82 | llc_pdu_init_as_xid_cmd(skb, LLC_XID_NULL_CLASS_2, 0); | 82 | llc_pdu_init_as_xid_cmd(skb, LLC_XID_NULL_CLASS_2, 0); |
83 | rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac); | 83 | rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac); |
84 | if (!rc) | 84 | if (likely(!rc)) |
85 | rc = dev_queue_xmit(skb); | 85 | rc = dev_queue_xmit(skb); |
86 | return rc; | 86 | return rc; |
87 | } | 87 | } |
@@ -110,7 +110,7 @@ int llc_sap_action_send_xid_r(struct llc_sap *sap, struct sk_buff *skb) | |||
110 | LLC_PDU_RSP); | 110 | LLC_PDU_RSP); |
111 | llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 0); | 111 | llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 0); |
112 | rc = llc_mac_hdr_init(nskb, mac_sa, mac_da); | 112 | rc = llc_mac_hdr_init(nskb, mac_sa, mac_da); |
113 | if (!rc) | 113 | if (likely(!rc)) |
114 | rc = dev_queue_xmit(nskb); | 114 | rc = dev_queue_xmit(nskb); |
115 | out: | 115 | out: |
116 | return rc; | 116 | return rc; |
@@ -134,7 +134,7 @@ int llc_sap_action_send_test_c(struct llc_sap *sap, struct sk_buff *skb) | |||
134 | ev->daddr.lsap, LLC_PDU_CMD); | 134 | ev->daddr.lsap, LLC_PDU_CMD); |
135 | llc_pdu_init_as_test_cmd(skb); | 135 | llc_pdu_init_as_test_cmd(skb); |
136 | rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac); | 136 | rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac); |
137 | if (!rc) | 137 | if (likely(!rc)) |
138 | rc = dev_queue_xmit(skb); | 138 | rc = dev_queue_xmit(skb); |
139 | return rc; | 139 | return rc; |
140 | } | 140 | } |
@@ -155,7 +155,7 @@ int llc_sap_action_send_test_r(struct llc_sap *sap, struct sk_buff *skb) | |||
155 | LLC_PDU_RSP); | 155 | LLC_PDU_RSP); |
156 | llc_pdu_init_as_test_rsp(nskb, skb); | 156 | llc_pdu_init_as_test_rsp(nskb, skb); |
157 | rc = llc_mac_hdr_init(nskb, mac_sa, mac_da); | 157 | rc = llc_mac_hdr_init(nskb, mac_sa, mac_da); |
158 | if (!rc) | 158 | if (likely(!rc)) |
159 | rc = dev_queue_xmit(nskb); | 159 | rc = dev_queue_xmit(nskb); |
160 | out: | 160 | out: |
161 | return rc; | 161 | return rc; |
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c index 2d764b0382ce..ec4693fe312f 100644 --- a/net/llc/llc_station.c +++ b/net/llc/llc_station.c | |||
@@ -261,7 +261,7 @@ static int llc_station_ac_send_null_dsap_xid_c(struct sk_buff *skb) | |||
261 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD); | 261 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD); |
262 | llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127); | 262 | llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127); |
263 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, llc_station_mac_sa); | 263 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, llc_station_mac_sa); |
264 | if (rc) | 264 | if (unlikely(rc)) |
265 | goto free; | 265 | goto free; |
266 | llc_station_send_pdu(nskb); | 266 | llc_station_send_pdu(nskb); |
267 | out: | 267 | out: |
@@ -285,7 +285,7 @@ static int llc_station_ac_send_xid_r(struct sk_buff *skb) | |||
285 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); | 285 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); |
286 | llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127); | 286 | llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127); |
287 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); | 287 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); |
288 | if (rc) | 288 | if (unlikely(rc)) |
289 | goto free; | 289 | goto free; |
290 | llc_station_send_pdu(nskb); | 290 | llc_station_send_pdu(nskb); |
291 | out: | 291 | out: |
@@ -309,7 +309,7 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb) | |||
309 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); | 309 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); |
310 | llc_pdu_init_as_test_rsp(nskb, skb); | 310 | llc_pdu_init_as_test_rsp(nskb, skb); |
311 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); | 311 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); |
312 | if (rc) | 312 | if (unlikely(rc)) |
313 | goto free; | 313 | goto free; |
314 | llc_station_send_pdu(nskb); | 314 | llc_station_send_pdu(nskb); |
315 | out: | 315 | out: |