Skip to contentSkip to conversation

EDAC, sb_edac.c: Fix signedness bugs in *_get_ha() functions.

DISCUSSION Borislav Petkov 1 participant 1 message Sep 15, 2018 EDAC-core

lore
Share & tools
lore

Borislav Petkov

author maintainer Applied
#0 lore raw
Quoted 8 lines · Tony

A static checker gave the following warnings:

drivers/edac/sb_edac.c:1030 ibridge_get_ha() warn: signedness bug returning '(-22)' drivers/edac/sb_edac.c:1037 knl_get_ha() warn: signedness bug returning '(-22)'

Both because the functions are declared to return a "u8", but try to return -EINVAL for the error case.

Quoted 8 lines

Fix by returning 0xff (since the caller doesn't look at, or pass on, the return value).

---
 drivers/edac/sb_edac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied,
thanks.