memory: fsl_ifc: fix leak of IO mapping on probe failure
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Thu, 27 May 2021 15:43:21 +0000 (11:43 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:17:55 +0000 (16:17 +0200)
commit6b3b002de90738e3c85853a682ce7e0fa078d42b
treedec680046fae653d9ee2930f9c5fd0857cdae2d9
parent00a6931183bae5b42fba1c018f2045e0b1f4027c
memory: fsl_ifc: fix leak of IO mapping on probe failure

[ Upstream commit 3b132ab67fc7a358fff35e808fa65d4bea452521 ]

On probe error the driver should unmap the IO memory.  Smatch reports:

  drivers/memory/fsl_ifc.c:298 fsl_ifc_ctrl_probe() warn: 'fsl_ifc_ctrl_dev->gregs' not released on lines: 298.

Fixes: a20cbdeffce2 ("powerpc/fsl: Add support for Integrated Flash Controller")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210527154322.81253-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/memory/fsl_ifc.c