All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Zheyu Ma <zheyuma97@gmail.com>
To: t.schramm@manjaro.org, sre@kernel.org
Cc: linux-pm@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [BUG] power: supply: cw2015: Found a bug when removing the module
Date: Sat, 16 Jul 2022 16:50:08 +0800	[thread overview]
Message-ID: <CAMhUBjkMyRP2iyMpovN7=GFP2SSpt+Na453RR6nNSBeyQR6oww@mail.gmail.com> (raw)

Hello,

I found a bug in the cw2015 driver.

When I insmod the kernel module, I get the following log:

[  199.445154] cw2015 0-0010: probe
[  199.445447] cw2015 0-0010: No battery-profile found, using current
flash contents
[  199.447198] cw2015 0-0010: Can't check current battery profile, no
profile provided
[  199.448577] cw2015 0-0010: No monitored battery, some properties
will be missing
[  199.449556] i2c-core: driver [cw2015] registered
[  199.482970] cw2015 0-0010: No profile specified, continuing without profile
[  199.486086] cw2015 0-0010: Failed to get supply state: -19

And when I remove the module, I got the following warning:

[  200.470198] cw2015 0-0010: remove
[  200.471445] ------------[ cut here ]------------
[  200.472752] WARNING: CPU: 0 PID: 413 at drivers/base/devres.c:1058
devm_kfree+0x2a8/0x330
[  200.478314] RIP: 0010:devm_kfree+0x2a8/0x330
[  200.485019] Call Trace:
[  200.485226]  <TASK>
[  200.485405]  ? power_supply_put_battery_info+0xc2/0xe0
[  200.486169]  cw_bat_remove+0x89/0xa0 [cw2015_battery]
[  200.486570]  i2c_device_remove+0x181/0x1f0

I think the problem is that the driver fails to call the function
power_supply_get_battery_info(). However, when removing the module,
the driver executes power_supply_put_battery_info(), causing a
warning.

Since I'm not familiar with this driver, I will just report the bug to you.

regards,

Zheyu Ma

             reply	other threads:[~2022-07-16  8:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-16  8:50 Zheyu Ma [this message]
2022-07-16 19:23 ` [BUG] power: supply: cw2015: Found a bug when removing the module Sebastian Reichel

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='CAMhUBjkMyRP2iyMpovN7=GFP2SSpt+Na453RR6nNSBeyQR6oww@mail.gmail.com' \
    --to=zheyuma97@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    --cc=t.schramm@manjaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.