Bluetooth: Use the proper error value from bt_skb_send_alloc()
[pandora-kernel.git] / net / sctp / sm_sideeffect.c
index eb1f42f..b21b218 100644 (file)
@@ -47,6 +47,8 @@
  * be incorporated into the next SCTP release.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/skbuff.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -732,11 +734,15 @@ static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds,
 {
        struct sctp_transport *t;
 
-       t = sctp_assoc_choose_alter_transport(asoc,
+       if (chunk->transport)
+               t = chunk->transport;
+       else {
+               t = sctp_assoc_choose_alter_transport(asoc,
                                              asoc->shutdown_last_sent_to);
+               chunk->transport = t;
+       }
        asoc->shutdown_last_sent_to = t;
        asoc->timeouts[SCTP_EVENT_TIMEOUT_T2_SHUTDOWN] = t->rto;
-       chunk->transport = t;
 }
 
 /* Helper function to change the state of an association. */
@@ -888,8 +894,6 @@ static void sctp_cmd_process_fwdtsn(struct sctp_ulpq *ulpq,
        sctp_walk_fwdtsn(skip, chunk) {
                sctp_ulpq_skip(ulpq, ntohs(skip->stream), ntohs(skip->ssn));
        }
-
-       return;
 }
 
 /* Helper function to remove the association non-primary peer
@@ -908,8 +912,6 @@ static void sctp_cmd_del_non_primary(struct sctp_association *asoc)
                        sctp_assoc_del_peer(asoc, &t->ipaddr);
                }
        }
-
-       return;
 }
 
 /* Helper function to set sk_err on a 1-1 style socket. */
@@ -1146,26 +1148,23 @@ static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
 
        case SCTP_DISPOSITION_VIOLATION:
                if (net_ratelimit())
-                       printk(KERN_ERR "sctp protocol violation state %d "
-                              "chunkid %d\n", state, subtype.chunk);
+                       pr_err("protocol violation state %d chunkid %d\n",
+                              state, subtype.chunk);
                break;
 
        case SCTP_DISPOSITION_NOT_IMPL:
-               printk(KERN_WARNING "sctp unimplemented feature in state %d, "
-                      "event_type %d, event_id %d\n",
-                      state, event_type, subtype.chunk);
+               pr_warn("unimplemented feature in state %d, event_type %d, event_id %d\n",
+                       state, event_type, subtype.chunk);
                break;
 
        case SCTP_DISPOSITION_BUG:
-               printk(KERN_ERR "sctp bug in state %d, "
-                      "event_type %d, event_id %d\n",
+               pr_err("bug in state %d, event_type %d, event_id %d\n",
                       state, event_type, subtype.chunk);
                BUG();
                break;
 
        default:
-               printk(KERN_ERR "sctp impossible disposition %d "
-                      "in state %d, event_type %d, event_id %d\n",
+               pr_err("impossible disposition %d in state %d, event_type %d, event_id %d\n",
                       status, state, event_type, subtype.chunk);
                BUG();
                break;
@@ -1679,8 +1678,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
                        sctp_cmd_send_asconf(asoc);
                        break;
                default:
-                       printk(KERN_WARNING "Impossible command: %u, %p\n",
-                              cmd->verb, cmd->obj.ptr);
+                       pr_warn("Impossible command: %u, %p\n",
+                               cmd->verb, cmd->obj.ptr);
                        break;
                }