diff options
Diffstat (limited to 'net/netrom/af_netrom.c')
-rw-r--r-- | net/netrom/af_netrom.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 8d0f30a015df..053fa26ff90a 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
@@ -1074,6 +1074,7 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1074 | goto out; | 1074 | goto out; |
1075 | 1075 | ||
1076 | skb_reserve(skb, size - len); | 1076 | skb_reserve(skb, size - len); |
1077 | skb_reset_transport_header(skb); | ||
1077 | 1078 | ||
1078 | /* | 1079 | /* |
1079 | * Push down the NET/ROM header | 1080 | * Push down the NET/ROM header |
@@ -1094,14 +1095,12 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1094 | /* | 1095 | /* |
1095 | * Put the data on the end | 1096 | * Put the data on the end |
1096 | */ | 1097 | */ |
1098 | skb_put(skb, len); | ||
1097 | 1099 | ||
1098 | skb->h.raw = skb_put(skb, len); | ||
1099 | |||
1100 | asmptr = skb->h.raw; | ||
1101 | SOCK_DEBUG(sk, "NET/ROM: Appending user data\n"); | 1100 | SOCK_DEBUG(sk, "NET/ROM: Appending user data\n"); |
1102 | 1101 | ||
1103 | /* User data follows immediately after the NET/ROM transport header */ | 1102 | /* User data follows immediately after the NET/ROM transport header */ |
1104 | if (memcpy_fromiovec(asmptr, msg->msg_iov, len)) { | 1103 | if (memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len)) { |
1105 | kfree_skb(skb); | 1104 | kfree_skb(skb); |
1106 | err = -EFAULT; | 1105 | err = -EFAULT; |
1107 | goto out; | 1106 | goto out; |