mirror of
https://github.com/LineageOS/android_kernel_fxtec_sm6115.git
synced 2026-08-18 13:51:00 +00:00
fjes: Add missing iounmap in fjes_hw_init()
commit 15ef641a0c6728d25a400df73922e80ab2cf029c upstream.
In error paths, add fjes_hw_iounmap() to release the
resource acquired by fjes_hw_iomap(). Add a goto label
to do so.
Fixes: 8cdc3f6c5d ("fjes: Hardware initialization routine")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Simon Horman <horms@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251211073756.101824-1-lihaoxiang@isrc.iscas.ac.cn
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ulrich Hecht <uli@kernel.org>
This commit is contained in:
committed by
Ulrich Hecht
parent
cf152ccb58
commit
e2b4cd018c
@ -348,7 +348,7 @@ int fjes_hw_init(struct fjes_hw *hw)
|
||||
|
||||
ret = fjes_hw_reset(hw);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_iounmap;
|
||||
|
||||
fjes_hw_set_irqmask(hw, REG_ICTL_MASK_ALL, true);
|
||||
|
||||
@ -361,8 +361,10 @@ int fjes_hw_init(struct fjes_hw *hw)
|
||||
hw->max_epid = fjes_hw_get_max_epid(hw);
|
||||
hw->my_epid = fjes_hw_get_my_epid(hw);
|
||||
|
||||
if ((hw->max_epid == 0) || (hw->my_epid >= hw->max_epid))
|
||||
return -ENXIO;
|
||||
if ((hw->max_epid == 0) || (hw->my_epid >= hw->max_epid)) {
|
||||
ret = -ENXIO;
|
||||
goto err_iounmap;
|
||||
}
|
||||
|
||||
ret = fjes_hw_setup(hw);
|
||||
|
||||
@ -370,6 +372,10 @@ int fjes_hw_init(struct fjes_hw *hw)
|
||||
hw->hw_info.trace_size = FJES_DEBUG_BUFFER_SIZE;
|
||||
|
||||
return ret;
|
||||
|
||||
err_iounmap:
|
||||
fjes_hw_iounmap(hw);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void fjes_hw_exit(struct fjes_hw *hw)
|
||||
|
||||
Reference in New Issue
Block a user