From: Ian Abbott Date: Fri, 22 May 2015 15:21:35 +0000 (+0100) Subject: staging: comedi: 8255: fix I/O region leak on failure X-Git-Tag: omap-for-v4.3/legacy-v2-signed~121^2~548 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e0b1b60cb0d7d3ae4c22a891e11ceccca17afee;p=pandora-kernel.git staging: comedi: 8255: fix I/O region leak on failure The Comedi "8255" driver does not clean up properly on failure. It can leave requested I/O port regions unreleased. Specifically, the Comedi "attach" handler (`dev_8255_attach()`) requests a specified I/O port region before calling `subdev_8255_init()` to set up the subdevice. If that fails, the "attach" handler returns an error and the Comedi core will call the "detach" handler (`dev_8255_detach()`) to clean up. The "detach" handler is responsible for releasing the I/O port regions successfully requested by the "attach" handler. Unfortunately, it is unable to obtain the base address of the region if the call to `subdev_8255_init()` failed. Fix the I/O region leak by releasing the region in the "attach" handler directly if the call to `subdev_8255_init()` fails. Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed