summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2026-07-12 14:37:28 -0700
committerDamien Le Moal <dlemoal@kernel.org>2026-07-13 14:32:11 +0900
commitc2130f6553f4a5cbdc259de069600117a995f197 (patch)
treebf28b120b1e0bd917c2c44ffb9f6ee99d594148e /include/linux
parent66c4e310ad71f41e41736d33dd8a1fb5eaaec7f3 (diff)
ata: sata_dwc_460ex: fix infinite loop in NCQ tag completion bit-scanning
The hand-rolled bit-scanning loop in the NCQ completion path has an infinite loop bug. When tag_mask has only high bits set (e.g. 0x80000000), the inner while loop left-shifts tag_mask until it overflows to 0. At that point !(0 & 1) is always true and 0 <<= 1 stays 0, causing an infinite loop in hardirq context with a spinlock held. Replace the open-coded bit-scanning with __ffs() which correctly finds the least significant set bit and is bounded by the width of the argument. Fixes: 62936009f35a ("[libata] Add 460EX on-chip SATA driver, sata_dwc_460ex") Assisted-by: opencode:big-pickle Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions