]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
smartpqi: Drop spinlock before freeing memory
authorJohn F. Carr <jfc@mit.edu>
Thu, 19 Oct 2023 03:02:42 +0000 (21:02 -0600)
committerWarner Losh <imp@FreeBSD.org>
Mon, 19 Feb 2024 06:59:36 +0000 (23:59 -0700)
commitda2e35b0ec99e979963923ed6392b3e883f40eb2
tree21560f201cc3e2a1a79ce4672cf0d65072cc30ea
parentc6edb21e3763b55b4102cb08d62a51abcf3cbd4c
smartpqi: Drop spinlock before freeing memory

pqisrc_free_device frees the device softc with the os spinlock
held. This causes crashes when devices are removed because the memory
free might sleep (which is prohibited with spin locks held). Drop the
spinlock before releasing the memory.

MFC After: 2 days
PR: 273289
Reviewed by: imp

This is the alternate fix from the box.

(this is not a cherry pick of b064a4c9eed5b1dd2a40fc4fd2cb7e738b681547)

(cherry picked from commit 898e02d740741d13a8948cbad4e0d969a768fd30)

Approved-by: re (cperciva)
sys/dev/smartpqi/smartpqi_discovery.c