irda: Free skb on irda_accept error path.
authorphil.turnbull@oracle.com <phil.turnbull@oracle.com>
Thu, 15 Sep 2016 16:41:44 +0000 (12:41 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 20 Nov 2016 01:01:41 +0000 (01:01 +0000)
commit5b673d345f17cbad2fc9b15783ca8d0e0682db3f
tree37877e5bce8ad42077acf18e6f414cc72d554487
parenta289c65ca49d2680a3d797e633e57a45573d1df2
irda: Free skb on irda_accept error path.

commit 8ab86c00e349cef9fb14719093a7f198bcc72629 upstream.

skb is not freed if newsk is NULL. Rework the error path so free_skb is
unconditionally called on function exit.

Fixes: c3ea9fa27413 ("[IrDA] af_irda: IRDA_ASSERT cleanups")
Signed-off-by: Phil Turnbull <phil.turnbull@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/irda/af_irda.c