via-ircc: don't return zero if via_ircc_open() failed
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 16 Aug 2013 20:48:14 +0000 (23:48 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Aug 2013 20:27:28 +0000 (13:27 -0700)
commit18ebe5c1c63b46f1acc41f68af5d82d6b7b39d73
treec35d67ceb9594d9de35eab88ac011aacc796fd1d
parente5733321d5a94cc9a202ea85c4aabe09571217e6
via-ircc: don't return zero if via_ircc_open() failed

If via_ircc_open() fails, data structures of the driver left uninitialized,
but probe (via_init_one()) returns zero. That can lead to null pointer dereference
in via_remove_one(), since it does not check drvdata for NULL.

The patch implements proper error code propagation.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/irda/via-ircc.c