diff options
| author | Jaeyoon Choi <jaeyoon@FreeBSD.org> | 2026-08-10 01:37:00 +0000 |
|---|---|---|
| committer | Jaeyoon Choi <jaeyoon@FreeBSD.org> | 2026-08-10 02:28:48 +0000 |
| commit | 607189d789ac37fac03025cbf7dfb0d243b7c49e (patch) | |
| tree | bf3fb25ceb2513d91c25723210a30219679a2d75 | |
| parent | 360b7c1635ea772d41275f8d1061cef4e131e328 (diff) | |
ufshci: free the lookup path when the periph search times out
ufshci_sim_find_periph() freed the lookup path only when it found the
periph. The timeout path returned without freeing it and leaked the
path. Free the path at the single exit instead.
Sponsored by: Samsung Electronics
Reviewed by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D58657
| -rw-r--r-- | sys/dev/ufshci/ufshci_sim.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ufshci/ufshci_sim.c b/sys/dev/ufshci/ufshci_sim.c index 234ee3bf7dfa..148840123d13 100644 --- a/sys/dev/ufshci/ufshci_sim.c +++ b/sys/dev/ufshci/ufshci_sim.c @@ -448,10 +448,8 @@ ufshci_sim_find_periph(struct ufshci_controller *ctrlr, uint8_t wlun) periph = cam_periph_find(path, "pass"); xpt_path_unlock(path); - if (periph) { - xpt_free_path(path); + if (periph) break; - } if (timeout - ticks < 0) { ufshci_printf(ctrlr, @@ -462,6 +460,8 @@ ufshci_sim_find_periph(struct ufshci_controller *ctrlr, uint8_t wlun) pause_sbt("ufshci_find_periph", ustosbt(100), 0, C_PREL(1)); } + xpt_free_path(path); + return periph; } |
