irda: Sock leak on error path in irda_create.

(backported from 2.6 commit 9ecad877948deb2871d29e03786a7d7911687009)

Bad type/protocol specified result in sk leak.

Fix is simple - release the sk if bad values are given,
but to make it possible just to call sk_free(), I move
some sk initialization a bit lower.

Signed-off-by: Pavel Emelyanov <>
Signed-off-by: David S. Miller <>
Signed-off-by: Willy Tarreau <>
1 file changed