diff options
Diffstat (limited to 'kernel/net/irda')
-rw-r--r-- | kernel/net/irda/af_irda.c | 7 | ||||
-rw-r--r-- | kernel/net/irda/iriap.c | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/kernel/net/irda/af_irda.c b/kernel/net/irda/af_irda.c index 923abd6b3..8d2f7c9b4 100644 --- a/kernel/net/irda/af_irda.c +++ b/kernel/net/irda/af_irda.c @@ -1024,8 +1024,11 @@ static int irda_connect(struct socket *sock, struct sockaddr *uaddr, } /* Check if we have opened a local TSAP */ - if (!self->tsap) - irda_open_tsap(self, LSAP_ANY, addr->sir_name); + if (!self->tsap) { + err = irda_open_tsap(self, LSAP_ANY, addr->sir_name); + if (err) + goto out; + } /* Move to connecting socket, start sending Connect Requests */ sock->state = SS_CONNECTING; diff --git a/kernel/net/irda/iriap.c b/kernel/net/irda/iriap.c index 4a7ae32af..1138eaf5c 100644 --- a/kernel/net/irda/iriap.c +++ b/kernel/net/irda/iriap.c @@ -185,8 +185,12 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv, self->magic = IAS_MAGIC; self->mode = mode; - if (mode == IAS_CLIENT) - iriap_register_lsap(self, slsap_sel, mode); + if (mode == IAS_CLIENT) { + if (iriap_register_lsap(self, slsap_sel, mode)) { + kfree(self); + return NULL; + } + } self->confirm = callback; self->priv = priv; |