Power management and ACPI fixes for final v4.5

- Revert a recent ACPICA commit that has been reverted
    upstream, because it caused problems to happen on user
    systems and the problem it attempted to address will not be
    relevant any more after upcoming ACPI specification changes
    (Bob Moore).
 
  - Fix crash in the generic device properties framework introduced
    by a recent change that forgot to check pointers against error
    values in addition to checking them against NULL (Heikki Krogerus).
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJW4srMAAoJEILEb/54YlRxlrcP/3sEZHqGWFrRoxSYfcJq3o3b
 bhDZNJTMcEqYFpC4j84PON2PN0bqIwUqW4EWrqQz0Rr1ry9iBNKDK6FxhHGkAhFg
 oMxkw8s0WtiLnl5IHUCH3lGpw8PdjLDy3hRoPCMVjVZ9bP1kVatlX03iYwEaEK3F
 TO3EtKj2aefbr8tPiPV+fCcEyUuVv00fugAtmWjASq37iGo7FpSYYMBSsedBLSGa
 D946spbHg/1zcRxE/4zmITQr+4iOkda5eagpbXFCdxaTNxRQcYRaAg1jAX9kz4jW
 W9BzSsW7HKJ8iu9eEHz8vKr5M6CtpNSHpBoR4DOPW78H+Zjff4uxtZ1kGBpj2Mc3
 vslvHlnsGRh2Limr7e0XFRxAXPIhuw1mviLkayqGD2srQVsFEVvnNSjogp0xIsMk
 mivdYNdhgWQ2CPjx4cXJMmpQIOsiqGG3wAz/PSVa73wNfuIJe+pMhHDZaEMEoMuX
 WyCiNgVASi8biR8H21GTjR+OFIF8KeQGHMnltsyIuW2ZpEhSl5Zo7FioYUR9rS9c
 1ZdJvpPBjT5YWhjbIA7uowp1aAhq2uD5HDU4ywL+beAJ9h/+E33hzXRewb0uB6LT
 yTnWRHNhJgdO6FxnHhGIbENlLtMWmb3BSqveMI4vUafy3TdO3xqVBzNRuVAKoOzX
 63z4hTL7vnexqV3i0qlY
 =Pi1c
 -----END PGP SIGNATURE-----

Merge tag 'pm+acpi-4.5-final' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management and ACPI fixes from Rafael Wysocki:
 "Two more fixes for issues introduced recently, one in the generic
  device properties framework and one in ACPICA.

  Specifics:

   - Revert a recent ACPICA commit that has been reverted upstream,
     because it caused problems to happen on user systems and the
     problem it attempted to address will not be relevant any more after
     upcoming ACPI specification changes (Bob Moore).

   - Fix crash in the generic device properties framework introduced by
     a recent change that forgot to check pointers against error values
     in addition to checking them against NULL (Heikki Krogerus)"

* tag 'pm+acpi-4.5-final' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  device property: fwnode->secondary may contain ERR_PTR(-ENODEV)
  ACPICA: Revert "Parser: Fix for SuperName method invocation"
This commit is contained in:
Linus Torvalds 2016-03-11 10:45:03 -08:00
commit 7ae9c768e1
2 changed files with 8 additions and 9 deletions

View File

@ -269,8 +269,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
*/
if (ACPI_SUCCESS(status) &&
possible_method_call && (node->type == ACPI_TYPE_METHOD)) {
if (GET_CURRENT_ARG_TYPE(walk_state->arg_types) ==
ARGP_SUPERNAME) {
if (walk_state->opcode == AML_UNLOAD_OP) {
/*
* acpi_ps_get_next_namestring has increased the AML pointer,
* so we need to restore the saved AML pointer for method call.
@ -697,7 +696,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
*
* PARAMETERS: walk_state - Current state
* parser_state - Current parser state object
* arg_type - The parser argument type (ARGP_*)
* arg_type - The argument type (AML_*_ARG)
* return_arg - Where the next arg is returned
*
* RETURN: Status, and an op object containing the next argument.
@ -817,9 +816,9 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
return_ACPI_STATUS(AE_NO_MEMORY);
}
/* super_name allows argument to be a method call */
/* To support super_name arg of Unload */
if (arg_type == ARGP_SUPERNAME) {
if (walk_state->opcode == AML_UNLOAD_OP) {
status =
acpi_ps_get_next_namepath(walk_state,
parser_state, arg,

View File

@ -218,7 +218,7 @@ bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname)
bool ret;
ret = __fwnode_property_present(fwnode, propname);
if (ret == false && fwnode && fwnode->secondary)
if (ret == false && fwnode && !IS_ERR_OR_NULL(fwnode->secondary))
ret = __fwnode_property_present(fwnode->secondary, propname);
return ret;
}
@ -423,7 +423,7 @@ EXPORT_SYMBOL_GPL(device_property_match_string);
int _ret_; \
_ret_ = FWNODE_PROP_READ(_fwnode_, _propname_, _type_, _proptype_, \
_val_, _nval_); \
if (_ret_ == -EINVAL && _fwnode_ && _fwnode_->secondary) \
if (_ret_ == -EINVAL && _fwnode_ && !IS_ERR_OR_NULL(_fwnode_->secondary)) \
_ret_ = FWNODE_PROP_READ(_fwnode_->secondary, _propname_, _type_, \
_proptype_, _val_, _nval_); \
_ret_; \
@ -593,7 +593,7 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
int ret;
ret = __fwnode_property_read_string_array(fwnode, propname, val, nval);
if (ret == -EINVAL && fwnode && fwnode->secondary)
if (ret == -EINVAL && fwnode && !IS_ERR_OR_NULL(fwnode->secondary))
ret = __fwnode_property_read_string_array(fwnode->secondary,
propname, val, nval);
return ret;
@ -621,7 +621,7 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode,
int ret;
ret = __fwnode_property_read_string(fwnode, propname, val);
if (ret == -EINVAL && fwnode && fwnode->secondary)
if (ret == -EINVAL && fwnode && !IS_ERR_OR_NULL(fwnode->secondary))
ret = __fwnode_property_read_string(fwnode->secondary,
propname, val);
return ret;