Commit fb348166 authored by Jean Tourrilhes's avatar Jean Tourrilhes Committed by Linus Torvalds

[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.
parent 8b0f201f
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment