summaryrefslogtreecommitdiffstats
path: root/kernel/net/irda/iriap.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/net/irda/iriap.c')
-rw-r--r--kernel/net/irda/iriap.c8
1 files changed, 6 insertions, 2 deletions
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;