Skip to content

Commit

Permalink
irda: Correctly clean up self->ias_obj on irda_bind() failure.
Browse files Browse the repository at this point in the history
If irda_open_tsap() fails, the irda_bind() code tries to destroy
the ->ias_obj object by hand, but does so wrongly.

In particular, it fails to a) release the hashbin attached to the
object and b) reset the self->ias_obj pointer to NULL.

Fix both problems by using irias_delete_object() and explicitly
setting self->ias_obj to NULL, just as irda_release() does.

Reported-by: Tavis Ormandy <taviso@cmpxchg8b.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Aug 31, 2010
1 parent 7619b1b commit 628e300
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/irda/af_irda.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,8 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)

err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name);
if (err < 0) {
kfree(self->ias_obj->name);
kfree(self->ias_obj);
irias_delete_object(self->ias_obj);
self->ias_obj = NULL;
goto out;
}

Expand Down

0 comments on commit 628e300

Please sign in to comment.