Commit 66b1cfc
bnxt_en: fix ternary sign extension bug in bnxt_show_temp()
[ Upstream commit 2753792 ]
The problem is that bnxt_show_temp() returns long but "rc" is an int
and "len" is a u32. With ternary operations the type promotion is quite
tricky. The negative "rc" is first promoted to u32 and then to long so
it ends up being a high positive value instead of a a negative as we
intended.
Fix this by removing the ternary.
Fixes: d69753f ("bnxt_en: return proper error codes in bnxt_show_temp")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 9f722ef commit 66b1cfc
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9546 | 9546 | | |
9547 | 9547 | | |
9548 | 9548 | | |
9549 | | - | |
| 9549 | + | |
| 9550 | + | |
| 9551 | + | |
9550 | 9552 | | |
9551 | 9553 | | |
9552 | 9554 | | |
| |||
0 commit comments