summaryrefslogtreecommitdiff
path: root/drivers/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorPhillip Potter <phil@philpotter.co.uk>2021-05-03 13:57:08 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-13 18:32:06 +0200
commitc446f0d4702d316e1c6bf621f70e79678d28830a (patch)
treef9745595831740c8b2293af599f87b699af885de /drivers/comedi/comedi_fops.c
parentabd7bca23bd4247124265152d00ffd4b2b0d6877 (diff)
isdn: mISDNinfineon: check/cleanup ioremap failure correctly in setup_io
Move hw->cfg.mode and hw->addr.mode assignments from hw->ci->cfg_mode and hw->ci->addr_mode respectively, to be before the subsequent checks for memory IO mode (and possible ioremap calls in this case). Also introduce ioremap error checks at both locations. This allows resources to be properly freed on ioremap failure, as when the caller of setup_io then subsequently calls release_io via its error path, release_io can now correctly determine the mode as it has been set before the ioremap call. Finally, refactor release_io function so that it will call release_mem_region in the memory IO case, regardless of whether or not hw->cfg.p/hw->addr.p are NULL. This means resources are then properly released on failure. This properly implements the original reverted commit (d721fe99f6ad) from the University of Minnesota, whilst also implementing the ioremap check for the hw->ci->cfg_mode if block as well. Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210503115736.2104747-42-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/comedi/comedi_fops.c')
0 files changed, 0 insertions, 0 deletions