Skip to content

Commit

Permalink
irda: irttp: fix memory leak in irttp_open_tsap() error path
Browse files Browse the repository at this point in the history
Cleanup the memory we allocated earlier in irttp_open_tsap() when we hit
this error path. The leak goes back to at least 1da177e
("Linux-2.6.12-rc2").

Discovered with Trinity (the syscall fuzzer).

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tommi Rantala authored and David S. Miller committed Nov 28, 2012
1 parent ba695af commit c3b2c25
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/irda/irttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify)
lsap = irlmp_open_lsap(stsap_sel, &ttp_notify, 0);
if (lsap == NULL) {
IRDA_DEBUG(0, "%s: unable to allocate LSAP!!\n", __func__);
__irttp_close_tsap(self);
return NULL;
}

Expand Down

0 comments on commit c3b2c25

Please sign in to comment.