From: Hans de Goede <hdegoede@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>, kbuild@lists.01.org
Cc: lkp@intel.com, kbuild-all@lists.01.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [pdx86-platform-drivers-x86:for-next 31/36] drivers/platform/x86/thinkpad_acpi.c:11154 thinkpad_acpi_module_exit() error: don't call input_free_device() after input_unregister_device()
Date: Thu, 2 Dec 2021 12:59:25 +0100 [thread overview]
Message-ID: <67b58b41-d5d4-5158-0da1-4a81b604172a@redhat.com> (raw)
In-Reply-To: <202111292341.pt8nIc7T-lkp@intel.com>
Hi Dan,
On 11/30/21 09:05, Dan Carpenter wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git for-next
> head: e9ff190973df2c417c2a97a8b70e709e0bdc2716
> commit: 67e7d50d13e94abeaf82e9945dce929352771b94 [31/36] platform/x86: thinkpad_acpi: Move input_unregister_device() to the top of thinkpad_acpi_module_exit()
> config: i386-randconfig-m021-20211129 (https://download.01.org/0day-ci/archive/20211129/202111292341.pt8nIc7T-lkp@intel.com/config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> New smatch warnings:
> drivers/platform/x86/thinkpad_acpi.c:11154 thinkpad_acpi_module_exit() error: don't call input_free_device() after input_unregister_device()
>
> vim +11154 drivers/platform/x86/thinkpad_acpi.c
>
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11130 static void thinkpad_acpi_module_exit(void)
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11131 {
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11132 struct ibm_struct *ibm, *itmp;
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11133
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11134 tpacpi_lifecycle = TPACPI_LIFE_EXITING;
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11135
> 67e7d50d13e94ab drivers/platform/x86/thinkpad_acpi.c Hans de Goede 2021-11-23 11136 if (tp_features.input_device_registered)
> 67e7d50d13e94ab drivers/platform/x86/thinkpad_acpi.c Hans de Goede 2021-11-23 11137 input_unregister_device(tpacpi_inputdev);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> 526ac103dbc6729 drivers/platform/x86/thinkpad_acpi.c Hans de Goede 2021-11-23 11138 if (tpacpi_hwmon)
> 526ac103dbc6729 drivers/platform/x86/thinkpad_acpi.c Hans de Goede 2021-11-23 11139 hwmon_device_unregister(tpacpi_hwmon);
> 2f5ad08f3eec8d4 drivers/platform/x86/thinkpad_acpi.c Hans de Goede 2021-11-23 11140 if (tp_features.sensors_pdrv_registered)
> 2f5ad08f3eec8d4 drivers/platform/x86/thinkpad_acpi.c Hans de Goede 2021-11-23 11141 platform_driver_unregister(&tpacpi_hwmon_pdriver);
> 2f5ad08f3eec8d4 drivers/platform/x86/thinkpad_acpi.c Hans de Goede 2021-11-23 11142 if (tp_features.platform_drv_registered)
> 2f5ad08f3eec8d4 drivers/platform/x86/thinkpad_acpi.c Hans de Goede 2021-11-23 11143 platform_driver_unregister(&tpacpi_pdriver);
> 2f5ad08f3eec8d4 drivers/platform/x86/thinkpad_acpi.c Hans de Goede 2021-11-23 11144
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11145 list_for_each_entry_safe_reverse(ibm, itmp,
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11146 &tpacpi_all_drivers,
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11147 all_drivers) {
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11148 ibm_exit(ibm);
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11149 }
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11150
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11151 dbg_printk(TPACPI_DBG_INIT, "finished subdriver exit path...\n");
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 11152
> 67e7d50d13e94ab drivers/platform/x86/thinkpad_acpi.c Hans de Goede 2021-11-23 11153 if (tpacpi_inputdev)
> b21a15f6d065e83 drivers/misc/thinkpad_acpi.c Henrique de Moraes Holschuh 2008-01-08 @11154 input_free_device(tpacpi_inputdev);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> I haven't seen this warning in a long time, so I forget why it exists.
> But apparently it's against the rules. :P
Yes, this is my bad. I've dropped this cleanup patch from the pdx86 for-next branch now,
since clearly this is a bad idea.
Thank you for catching this.
Regards,
Hans
prev parent reply other threads:[~2021-12-02 11:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 8:05 Dan Carpenter
2021-12-02 11:59 ` Hans de Goede [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=67b58b41-d5d4-5158-0da1-4a81b604172a@redhat.com \
--to=hdegoede@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dan.carpenter@oracle.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®