[media] lirc_imon: simplify error handling code
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 5 Jun 2015 14:06:46 +0000 (11:06 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 5 Jun 2015 14:26:48 +0000 (11:26 -0300)
commitaf8a819a2513df4be461c6a29e3bdee6e23cf3be
tree84f7e0ec0e3b33b791484f5d1d0b9ea0b1c73a97
parentb295e5c7d84721f76d1728f2ee4152a8cbb6ddaa
[media] lirc_imon: simplify error handling code

Instead of using a state machine and a switch with lots of
fall-trough, use gotos and cleanup the error handling loop.

That removes those two smatch warnings:
drivers/staging/media/lirc/lirc_imon.c:933 imon_probe() warn: possible memory leak of 'context'
drivers/staging/media/lirc/lirc_imon.c:933 imon_probe() warn: possible memory leak of 'driver'

And make the error handling code more standard.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/staging/media/lirc/lirc_imon.c