Linux ACPI
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [bug report] ACPI: battery: Adjust event notification routine
Date: Fri, 6 Feb 2026 16:40:27 +0300	[thread overview]
Message-ID: <aYXvS1h3Bxf_5sCj@stanley.mountain> (raw)
In-Reply-To: <caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain>

[ Smatch checking is paused while we raise funding.  #SadFace
  https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]


Hello Rafael J. Wysocki,

This is a semi-automatic email about new static checker warnings.

Commit 08b54fd57782 ("ACPI: battery: Adjust event notification
routine") from Dec 15, 2025, leads to the following Smatch complaint:

    drivers/acpi/battery.c:1062 acpi_battery_notify()
    warn: variable dereferenced before check 'battery' (see line 1059)

drivers/acpi/battery.c
  1058		struct acpi_battery *battery = data;
  1059		struct acpi_device *device = battery->device;
                                             ^^^^^^^^^^^^^^^
The patch adds a dereference.

  1060		struct power_supply *old;
  1061	
  1062		if (!battery)
                    ^^^^^^^^
Checked too late.

  1063			return;
  1064	

regards,
dan carpenter

       reply	other threads:[~2026-02-06 13:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain>
2026-02-06 13:40 ` Dan Carpenter [this message]
2026-02-06 21:28   ` [PATCH v1] ACPI: battery: Drop redundant check from acpi_battery_notify() Rafael J. Wysocki

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=aYXvS1h3Bxf_5sCj@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@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