All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: aaron.lu@intel.com
Cc: linux-acpi@vger.kernel.org
Subject: re: ACPI / video: Run _BCL before deciding registering backlight
Date: Sat, 20 Jun 2015 15:26:39 +0300	[thread overview]
Message-ID: <20150620122639.GA22193@mwanda> (raw)

Hello Aaron Lu,

The patch dce4ec2e452f: "ACPI / video: Run _BCL before deciding
registering backlight" from Oct 28, 2014, leads to the following
static checker warning:

	drivers/acpi/acpi_video.c:1659 acpi_video_run_bcl_for_osi()
	warn: calling kfree() when 'levels' is always NULL.

drivers/acpi/acpi_video.c
  1651  static void acpi_video_run_bcl_for_osi(struct acpi_video_bus *video)
  1652  {
  1653          struct acpi_video_device *dev;
  1654          union acpi_object *levels;
  1655  
  1656          mutex_lock(&video->device_list_lock);
  1657          list_for_each_entry(dev, &video->video_device_list, entry) {
  1658                  if (!acpi_video_device_lcd_query_levels(dev, &levels))
  1659                          kfree(levels);

kfree(NULL) is a no-op.  We could just remove the if statement here.

		list_for_each_entry(dev, &video->video_device_list, entry) {
			acpi_video_device_lcd_query_levels(dev, &levels);
		}

But then it's not clear to me the point of this loop is?

  1660          }
  1661          mutex_unlock(&video->device_list_lock);
  1662  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in

             reply	other threads:[~2015-06-20 12:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-20 12:26 Dan Carpenter [this message]
2015-06-20 12:34 ` ACPI / video: Run _BCL before deciding registering backlight Dan Carpenter

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=20150620122639.GA22193@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=aaron.lu@intel.com \
    --cc=linux-acpi@vger.kernel.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.