aboutsummaryrefslogtreecommitdiff
path: root/lib/netdev-notifier-error-inject.c
diff options
context:
space:
mode:
authorLinus Torvalds <[email protected]>2024-07-28 17:06:20 -0700
committerLinus Torvalds <[email protected]>2024-07-28 17:06:20 -0700
commit9f499b8c791d2983c0a31a543c51d1b2f15e8755 (patch)
tree061fcd36991e93a95a0550763b0a560d9a1a6798 /lib/netdev-notifier-error-inject.c
parent1a251f52cfdc417c84411a056bc142cbd77baef4 (diff)
minmax: scsi: fix mis-use of 'clamp()' in sr.c
While working on simplifying the minmax functions, and avoiding excessive macro expansion, it turns out that the sr.c use of the 'clamp()' macro has the arguments the wrong way around. The clamp logic is val = clamp(in, low, high); and it returns the input clamped to the low/high limits. But sr.c ddid speed = clamp(0, speed, 0xffff / 177); which clamps the value '0' to the range '[speed, 0xffff / 177]' and ends up being nonsensical. Happily, I don't think anybody ever cared. Fixes: 9fad9d560af5 ("scsi: sr: Fix unintentional arithmetic wraparound") Cc: Justin Stitt <[email protected]> Cc: Kees Cook <[email protected]> Cc: Martin K. Petersen <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/netdev-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions