aboutsummaryrefslogtreecommitdiffstats
path: root/net/netrom
diff options
context:
space:
mode:
Diffstat (limited to 'net/netrom')
-rw-r--r--net/netrom/af_netrom.c3
-rw-r--r--net/netrom/nr_route.c23
2 files changed, 15 insertions, 11 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 3df7c5a..b4d889b 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1182,10 +1182,9 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
sax->sax25_family = AF_NETROM;
skb_copy_from_linear_data_offset(skb, 7, sax->sax25_call.ax25_call,
AX25_ADDR_LEN);
+ msg->msg_namelen = sizeof(*sax);
}
- msg->msg_namelen = sizeof(*sax);
-
skb_free_datagram(sk, skb);
release_sock(sk);
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c
index 44059d0..915a87b 100644
--- a/net/netrom/nr_route.c
+++ b/net/netrom/nr_route.c
@@ -37,6 +37,7 @@
#include <linux/spinlock.h>
#include <net/netrom.h>
#include <linux/seq_file.h>
+#include <linux/export.h>
static unsigned int nr_neigh_no = 1;
@@ -257,9 +258,12 @@ static int __must_check nr_add_node(ax25_address *nr, const char *mnemonic,
case 3:
if (nr_node->routes[1].quality > nr_node->routes[0].quality) {
switch (nr_node->which) {
- case 0: nr_node->which = 1; break;
- case 1: nr_node->which = 0; break;
- default: break;
+ case 0:
+ nr_node->which = 1;
+ break;
+ case 1:
+ nr_node->which = 0;
+ break;
}
nr_route = nr_node->routes[0];
nr_node->routes[0] = nr_node->routes[1];
@@ -505,12 +509,13 @@ static int nr_dec_obs(void)
s->count--;
switch (i) {
- case 0:
- s->routes[0] = s->routes[1];
- case 1:
- s->routes[1] = s->routes[2];
- case 2:
- break;
+ case 0:
+ s->routes[0] = s->routes[1];
+ /* Fallthrough */
+ case 1:
+ s->routes[1] = s->routes[2];
+ case 2:
+ break;
}
break;