platform/x86: hp-bioscfg: fix a signedness bug in hp_wmi_perform_query()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 18 Jul 2023 07:05:05 +0000 (10:05 +0300)
committerHans de Goede <hdegoede@redhat.com>
Wed, 26 Jul 2023 14:15:45 +0000 (16:15 +0200)
commit93d99fd8e605c09ae8521a19c2b08b57b8cc4165
tree8f9ddeb2d2d998159bf723e44a8a59552343c149
parent5d36931f0fe51665c04f56c027613d22e6a03411
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: 69ea03e38f24 ("platform/x86: hp-bioscfg: biosattr-interface")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/ad0a6ad9-099b-40a4-ae91-b9dca622ff4e@moroto.mountain
Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c