lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 9 Sep 2022 07:43:24 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Eugene Shalygin <eugene.shalygin@...il.com>
Cc:     Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwmon: (asus-ec-sensors) autoload module via DMI data

On Fri, Sep 09, 2022 at 01:38:20PM +0200, Eugene Shalygin wrote:
> Replace autoloading data based on the ACPI EC device with the DMI
> records for motherboards models. The ACPI method created a bug that when
> this driver returns error from the probe function because of the
> unsupported motherboard model, the ACPI subsystem concludes
> that the EC device does not work properly.
> 
> Fixes: 5cd29012028d
> Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216412
> Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2121844
> Signed-off-by: Eugene Shalygin <eugene.shalygin@...il.com>
> ---
>  drivers/hwmon/asus-ec-sensors.c | 413 ++++++++++++++++++--------------
>  1 file changed, 227 insertions(+), 186 deletions(-)
> 
> diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
> index 61a4684fc020..206265ea8122 100644
> --- a/drivers/hwmon/asus-ec-sensors.c
> +++ b/drivers/hwmon/asus-ec-sensors.c

[ ... ]

> +
> +static void cleanup_device(void)
> +{
> +	platform_device_unregister(asus_ec_sensors_platform_device);
> +	platform_driver_unregister(&asus_ec_sensors_platform_driver);
> +}
> +
> +static int __init asus_ec_init(void)
> +{
> +	asus_ec_sensors_platform_device =
> +		platform_create_bundle(&asus_ec_sensors_platform_driver,
> +				       asus_ec_probe, NULL, 0, NULL, 0);
> +
> +	if (IS_ERR(asus_ec_sensors_platform_device))
> +		return PTR_ERR(asus_ec_sensors_platform_device);
> +
> +	return 0;
> +}
> +
> +static void __exit asus_ec_exit(void)
> +{
> +	cleanup_device();

I don't see the point of that extra function. Please drop and call
platform_device_unregister() as well as platform_driver_unregister()
directly.

> +}
> +
> +module_init(asus_ec_init);
> +module_exit(asus_ec_exit);
>  
>  module_param_named(mutex_path, mutex_path_override, charp, 0);
>  MODULE_PARM_DESC(mutex_path,
> -- 
> 2.37.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ