Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Dan Carpenter and committed by
Hans de Goede
93d99fd8 5d36931f

+1 -1
+1 -1
drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.c
··· 123 123 struct bios_return *bios_return; 124 124 union acpi_object *obj = NULL; 125 125 struct bios_args *args = NULL; 126 - u32 mid, actual_outsize, ret; 126 + int mid, actual_outsize, ret; 127 127 size_t bios_args_size; 128 128 129 129 mid = hp_encode_outsize_for_pvsz(outsize);