From fb34816661415f2ea828769d0a863a1dd2929b9f Mon Sep 17 00:00:00 2001 From: Jean Tourrilhes Date: Tue, 4 Nov 2003 19:45:22 -0800 Subject: [PATCH] [IRDA]: Fix IrLMP open leak. - Prevent 'self' leak on error in irlmp_open. ASSERT is compiled in only with DEBUG option => risk = 0. Original patch from Chris Wright. --- net/irda/irlmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index ff81de48eec3b..79a22f223db7f 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c @@ -146,6 +146,7 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid) ASSERT(notify != NULL, return NULL;); ASSERT(irlmp != NULL, return NULL;); ASSERT(irlmp->magic == LMP_MAGIC, return NULL;); + ASSERT(notify->instance != NULL, return NULL;); /* Does the client care which Source LSAP selector it gets? */ if (slsap_sel == LSAP_ANY) { @@ -178,7 +179,6 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid) init_timer(&self->watchdog_timer); - ASSERT(notify->instance != NULL, return NULL;); self->notify = *notify; self->lsap_state = LSAP_DISCONNECTED; -- 2.53.0