Staging: comedi: fix memory leak in comedi_bond.c
authorChase Southwood <chase.southwood@yahoo.com>
Sat, 8 Feb 2014 05:02:27 +0000 (23:02 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2014 20:22:32 +0000 (12:22 -0800)
commit777e5d3ed55749e44febe3ae18dd9f0050bb8102
treebff4d005fe66a21ffcd343775957b7b96f00a1df
parent8542373dccd2f5dd4dac0a552e2a22fc4402dbe9
Staging: comedi: fix memory leak in comedi_bond.c

We allocate bdev and then krealloc the devs pointer in order to add bdev
at the end of the devpriv->devs array list.  But if for some reason this
krealloc fails, we need to free bdev before returning an error otherwise
this memory is leaked.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Acked-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/comedi_bond.c