Skip to content
Commit c968ed08 authored by Tony Luck's avatar Tony Luck Committed by Borislav Petkov
Browse files

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



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.

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

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20180914201905.GA30946@agluck-desk


Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
parent 8489b17c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment