re: acer-wmi: fix obj is NULL but dereferenced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Lee, Chun-Yi,

The patch 727651bf738b: "acer-wmi: fix obj is NULL but dereferenced" 
from Dec 14, 2012, leads to the following warning:
drivers/platform/x86/acer-wmi.c:1227 WMID_set_capabilities()
	 warn: calling kfree() when 'out.pointer' is always NULL.

  1217          obj = (union acpi_object *) out.pointer;
  1218          if (obj) {
  1219                  if (obj->type == ACPI_TYPE_BUFFER &&
  1220                          (obj->buffer.length == sizeof(u32) ||
  1221                          obj->buffer.length == sizeof(u64))) {
  1222                          devices = *((u32 *) obj->buffer.pointer);
  1223                  } else if (obj->type == ACPI_TYPE_INTEGER) {
  1224                          devices = (u32) obj->integer.value;
  1225                  }
  1226          } else {
  1227                  kfree(out.pointer);
  1228                  return AE_ERROR;
  1229          }

I was going to remove the kfree() but looking the patch which introduced
it causes GCC warnings and so there is some other stuff which needs to
be fixed as well.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux