Commit 34f5f8d
drivers: adc: Prevent overflow in max1125x_read_sample
Fix potential integer overflow caused by unsafe shift when computing
ADC mid-scale offset. Applies resolution bounds and uses unsigned
shift to avoid undefined behavior.
Fixes: CID 487740
Signed-off-by: Sudarsan N <[email protected]>1 parent 1fbb4e8 commit 34f5f8d
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
406 | 412 | | |
| 413 | + | |
407 | 414 | | |
408 | | - | |
| 415 | + | |
| 416 | + | |
409 | 417 | | |
410 | 418 | | |
411 | 419 | | |
| |||
0 commit comments