net: irda: set error code on failures
authorPan Bian <bianpan2016@163.com>
Sun, 4 Dec 2016 05:27:40 +0000 (13:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Dec 2016 19:53:08 +0000 (14:53 -0500)
commit8ad3ba934587c8ecbfee13331d859a7849afdfbb
tree4ec7e0aef86a11e387e7242836f40dfec5063da0
parentc79e167c3cba066892542f3dfb5e73b7207e01df
net: irda: set error code on failures

When the calls to kzalloc() fail, the value of return variable ret may
be 0. 0 means success in this context. This patch fixes the bug,
assigning "-ENOMEM" to ret before calling kzalloc().

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188971

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/irda/irda-usb.c