aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/mISDN/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/mISDN/socket.c')
-rw-r--r--drivers/isdn/mISDN/socket.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 530f68977361..2a2c30a9438f 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -209,7 +209,7 @@ mISDN_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
209 209
210 if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) { 210 if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {
211 err = -EFAULT; 211 err = -EFAULT;
212 goto drop; 212 goto done;
213 } 213 }
214 214
215 memcpy(mISDN_HEAD_P(skb), skb->data, MISDN_HEADER_LEN); 215 memcpy(mISDN_HEAD_P(skb), skb->data, MISDN_HEADER_LEN);
@@ -230,19 +230,21 @@ mISDN_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
230 __func__, mISDN_HEAD_ID(skb)); 230 __func__, mISDN_HEAD_ID(skb));
231 231
232 err = -ENODEV; 232 err = -ENODEV;
233 if (!_pms(sk)->ch.peer || 233 if (!_pms(sk)->ch.peer)
234 (err = _pms(sk)->ch.recv(_pms(sk)->ch.peer, skb))) 234 goto done;
235 goto drop; 235 err = _pms(sk)->ch.recv(_pms(sk)->ch.peer, skb);
236 236 if (err)
237 err = len; 237 goto done;
238 else {
239 skb = NULL;
240 err = len;
241 }
238 242
239done: 243done:
244 if (skb)
245 kfree_skb(skb);
240 release_sock(sk); 246 release_sock(sk);
241 return err; 247 return err;
242
243drop:
244 kfree_skb(skb);
245 goto done;
246} 248}
247 249
248static int 250static int