Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fjes: Add missing iounmap in fjes_hw_init()

In error paths, add fjes_hw_iounmap() to release the
resource acquired by fjes_hw_iomap(). Add a goto label
to do so.

Fixes: 8cdc3f6c5d22 ("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>

authored by

Haoxiang Li and committed by
Paolo Abeni
15ef641a d1a1a4ba

+9 -3
+9 -3
drivers/net/fjes/fjes_hw.c
··· 334 334 335 335 ret = fjes_hw_reset(hw); 336 336 if (ret) 337 - return ret; 337 + goto err_iounmap; 338 338 339 339 fjes_hw_set_irqmask(hw, REG_ICTL_MASK_ALL, true); 340 340 ··· 347 347 hw->max_epid = fjes_hw_get_max_epid(hw); 348 348 hw->my_epid = fjes_hw_get_my_epid(hw); 349 349 350 - if ((hw->max_epid == 0) || (hw->my_epid >= hw->max_epid)) 351 - return -ENXIO; 350 + if ((hw->max_epid == 0) || (hw->my_epid >= hw->max_epid)) { 351 + ret = -ENXIO; 352 + goto err_iounmap; 353 + } 352 354 353 355 ret = fjes_hw_setup(hw); 354 356 355 357 hw->hw_info.trace = vzalloc(FJES_DEBUG_BUFFER_SIZE); 356 358 hw->hw_info.trace_size = FJES_DEBUG_BUFFER_SIZE; 357 359 360 + return ret; 361 + 362 + err_iounmap: 363 + fjes_hw_iounmap(hw); 358 364 return ret; 359 365 } 360 366