Skip to content

Commit

Permalink
ACER: Fix Smatch double-free issue
Browse files Browse the repository at this point in the history
The patch 6ae3a0876185: "ACER: Add support for accelerometer sensor"
from Jun 1, 2012, leads to the following Smatch warning:
drivers/platform/x86/acer-wmi.c:1886 acer_wmi_accel_destroy()
         error: don't call input_free_device() after input_unregister_device()

drivers/platform/x86/acer-wmi.c
  1883  static void acer_wmi_accel_destroy(void)
  1884  {
  1885          input_unregister_device(acer_wmi_accel_dev);
  1886          input_free_device(acer_wmi_accel_dev);
  1887  }

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Fengguang Wu <wfg@linux.intel.com>
Cc: joeyli <jlee@suse.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
  • Loading branch information
Marek Vasut authored and Matthew Garrett committed Jul 28, 2012
1 parent 24237c4 commit 1bfaf1d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/platform/x86/acer-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,6 @@ static int __init acer_wmi_accel_setup(void)
static void acer_wmi_accel_destroy(void)
{
input_unregister_device(acer_wmi_accel_dev);
input_free_device(acer_wmi_accel_dev);
}

static int __init acer_wmi_input_setup(void)
Expand Down

0 comments on commit 1bfaf1d

Please sign in to comment.