]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/netrom/af_netrom.c
Merge branch 'topic/hda' into for-linus
[karo-tx-linux.git] / net / netrom / af_netrom.c
index 4e705f87969f332c30939dc8acabd4f8d4d74352..3be0e016ab7df1bd34576816c1ea97232c36c7e8 100644 (file)
@@ -1084,8 +1084,10 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
 
        /* Build a packet - the conventional user limit is 236 bytes. We can
           do ludicrously large NetROM frames but must not overflow */
-       if (len > 65536)
-               return -EMSGSIZE;
+       if (len > 65536) {
+               err = -EMSGSIZE;
+               goto out;
+       }
 
        SOCK_DEBUG(sk, "NET/ROM: sendto: building packet.\n");
        size = len + NR_NETWORK_LEN + NR_TRANSPORT_LEN;