]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
platform/x86: lenovo-wmi-other: Zero initialize WMI arguments
authorDerek J. Clark <derekjohn.clark@gmail.com>
Sun, 10 May 2026 04:25:34 +0000 (04:25 +0000)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 11 May 2026 11:29:03 +0000 (14:29 +0300)
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.

Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Fixes: 22024ac5366f ("platform/x86: Add Lenovo Gamezone WMI Driver")
Fixes: edc4b183b794 ("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>
Link: https://patch.msgid.link/20260510042546.436874-5-derekjohn.clark@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/lenovo/wmi-gamezone.c
drivers/platform/x86/lenovo/wmi-other.c

index c7fe7e3c9f17919957fb6f581348ab78151be68a..098239c9311a6b1042440083b15b0c716bbf1240 100644 (file)
@@ -201,7 +201,7 @@ static int lwmi_gz_profile_set(struct device *dev,
                               enum platform_profile_option profile)
 {
        struct lwmi_gz_priv *priv = dev_get_drvdata(dev);
-       struct wmi_method_args_32 args;
+       struct wmi_method_args_32 args = {};
        enum thermal_mode mode;
        int ret;
 
index 70fcb8406c274f480a336648e71463e83a680585..c1b429269f8913c182b2ef1f4470eaf8c76cb721 100644 (file)
@@ -166,7 +166,7 @@ MODULE_PARM_DESC(relax_fan_constraint,
  */
 static int lwmi_om_fan_get_set(struct lwmi_om_priv *priv, int channel, u32 *val, bool set)
 {
-       struct wmi_method_args_32 args;
+       struct wmi_method_args_32 args = {};
        u32 method_id, retval;
        int err;
 
@@ -775,7 +775,7 @@ static ssize_t attr_current_value_store(struct kobject *kobj,
                                        struct tunable_attr_01 *tunable_attr)
 {
        struct lwmi_om_priv *priv = dev_get_drvdata(tunable_attr->dev);
-       struct wmi_method_args_32 args;
+       struct wmi_method_args_32 args = {};
        struct capdata01 capdata;
        enum thermal_mode mode;
        u32 attribute_id;
@@ -838,7 +838,7 @@ static ssize_t attr_current_value_show(struct kobject *kobj,
                                       struct tunable_attr_01 *tunable_attr)
 {
        struct lwmi_om_priv *priv = dev_get_drvdata(tunable_attr->dev);
-       struct wmi_method_args_32 args;
+       struct wmi_method_args_32 args = {};
        enum thermal_mode mode;
        u32 attribute_id;
        int retval;