Commit 93d99fd8 authored by Dan Carpenter's avatar Dan Carpenter Committed by Hans de Goede

platform/x86: hp-bioscfg: fix a signedness bug in hp_wmi_perform_query()

The error handling won't work if "mid" is unsigned.  "ret" is used to
store negative error codes and declaring it as a u32 won't cause a bug
but it's ugly.  The "actual_outsize" variable is a number between 0-4096
so it can be declared as int as well.

Fixes: 69ea03e3 ("platform/x86: hp-bioscfg: biosattr-interface")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/ad0a6ad9-099b-40a4-ae91-b9dca622ff4e@moroto.mountainReviewed-by: default avatarJorge Lopez <jorge.lopez2@hp.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 5d36931f
......@@ -123,7 +123,7 @@ int hp_wmi_perform_query(int query, enum hp_wmi_command command, void *buffer,
struct bios_return *bios_return;
union acpi_object *obj = NULL;
struct bios_args *args = NULL;
u32 mid, actual_outsize, ret;
int mid, actual_outsize, ret;
size_t bios_args_size;
mid = hp_encode_outsize_for_pvsz(outsize);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment