Skip to content

Commit bfe4a3c

Browse files
pastaq1Naim
authored andcommitted
platform/x86: lenovo-wmi-other: Zero initialize WMI arguments
Adds explicit initialization of wmi_method_args_32 declarations with zero values to prevent uninitialized data from being sent to the device BIOS when passed. No functional change intended. Fixes: 22024ac ("platform/x86: Add Lenovo Gamezone WMI Driver") Fixes: edc4b18 ("platform/x86: Add Lenovo Other Mode WMI Driver") Reported-by: Rong Zhang <i@rong.moe> Closes: https://lore.kernel.org/platform-driver-x86/95c7e7b539dd0af41189c754fcd35cec5b6fe182.camel@rong.moe/ Cc: stable@vger.kernel.org Reviewed-by: Rong Zhang <i@rong.moe> Tested-by: Rong Zhang <i@rong.moe> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
1 parent 22b77ab commit bfe4a3c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/platform/x86/lenovo/wmi-gamezone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static int lwmi_gz_profile_set(struct device *dev,
203203
enum platform_profile_option profile)
204204
{
205205
struct lwmi_gz_priv *priv = dev_get_drvdata(dev);
206-
struct wmi_method_args_32 args;
206+
struct wmi_method_args_32 args = {};
207207
enum thermal_mode mode;
208208
int ret;
209209

drivers/platform/x86/lenovo/wmi-other.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ MODULE_PARM_DESC(relax_fan_constraint,
166166
*/
167167
static int lwmi_om_fan_get_set(struct lwmi_om_priv *priv, int channel, u32 *val, bool set)
168168
{
169-
struct wmi_method_args_32 args;
169+
struct wmi_method_args_32 args = {};
170170
u32 method_id, retval;
171171
int err;
172172

@@ -773,7 +773,7 @@ static ssize_t attr_current_value_store(struct kobject *kobj,
773773
struct tunable_attr_01 *tunable_attr)
774774
{
775775
struct lwmi_om_priv *priv = dev_get_drvdata(tunable_attr->dev);
776-
struct wmi_method_args_32 args;
776+
struct wmi_method_args_32 args = {};
777777
struct capdata01 capdata;
778778
enum thermal_mode mode;
779779
u32 attribute_id;
@@ -836,7 +836,7 @@ static ssize_t attr_current_value_show(struct kobject *kobj,
836836
struct tunable_attr_01 *tunable_attr)
837837
{
838838
struct lwmi_om_priv *priv = dev_get_drvdata(tunable_attr->dev);
839-
struct wmi_method_args_32 args;
839+
struct wmi_method_args_32 args = {};
840840
enum thermal_mode mode;
841841
u32 attribute_id;
842842
int retval;

0 commit comments

Comments
 (0)