Skip to content

Commit 7ae9c76

Browse files
committed
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"
2 parents 2a62ec0 + 5b3e7e0 commit 7ae9c76

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

drivers/acpi/acpica/psargs.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
269269
*/
270270
if (ACPI_SUCCESS(status) &&
271271
possible_method_call && (node->type == ACPI_TYPE_METHOD)) {
272-
if (GET_CURRENT_ARG_TYPE(walk_state->arg_types) ==
273-
ARGP_SUPERNAME) {
272+
if (walk_state->opcode == AML_UNLOAD_OP) {
274273
/*
275274
* acpi_ps_get_next_namestring has increased the AML pointer,
276275
* 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
697696
*
698697
* PARAMETERS: walk_state - Current state
699698
* parser_state - Current parser state object
700-
* arg_type - The parser argument type (ARGP_*)
699+
* arg_type - The argument type (AML_*_ARG)
701700
* return_arg - Where the next arg is returned
702701
*
703702
* 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,
817816
return_ACPI_STATUS(AE_NO_MEMORY);
818817
}
819818

820-
/* super_name allows argument to be a method call */
819+
/* To support super_name arg of Unload */
821820

822-
if (arg_type == ARGP_SUPERNAME) {
821+
if (walk_state->opcode == AML_UNLOAD_OP) {
823822
status =
824823
acpi_ps_get_next_namepath(walk_state,
825824
parser_state, arg,

drivers/base/property.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname)
218218
bool ret;
219219

220220
ret = __fwnode_property_present(fwnode, propname);
221-
if (ret == false && fwnode && fwnode->secondary)
221+
if (ret == false && fwnode && !IS_ERR_OR_NULL(fwnode->secondary))
222222
ret = __fwnode_property_present(fwnode->secondary, propname);
223223
return ret;
224224
}
@@ -423,7 +423,7 @@ EXPORT_SYMBOL_GPL(device_property_match_string);
423423
int _ret_; \
424424
_ret_ = FWNODE_PROP_READ(_fwnode_, _propname_, _type_, _proptype_, \
425425
_val_, _nval_); \
426-
if (_ret_ == -EINVAL && _fwnode_ && _fwnode_->secondary) \
426+
if (_ret_ == -EINVAL && _fwnode_ && !IS_ERR_OR_NULL(_fwnode_->secondary)) \
427427
_ret_ = FWNODE_PROP_READ(_fwnode_->secondary, _propname_, _type_, \
428428
_proptype_, _val_, _nval_); \
429429
_ret_; \
@@ -593,7 +593,7 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
593593
int ret;
594594

595595
ret = __fwnode_property_read_string_array(fwnode, propname, val, nval);
596-
if (ret == -EINVAL && fwnode && fwnode->secondary)
596+
if (ret == -EINVAL && fwnode && !IS_ERR_OR_NULL(fwnode->secondary))
597597
ret = __fwnode_property_read_string_array(fwnode->secondary,
598598
propname, val, nval);
599599
return ret;
@@ -621,7 +621,7 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode,
621621
int ret;
622622

623623
ret = __fwnode_property_read_string(fwnode, propname, val);
624-
if (ret == -EINVAL && fwnode && fwnode->secondary)
624+
if (ret == -EINVAL && fwnode && !IS_ERR_OR_NULL(fwnode->secondary))
625625
ret = __fwnode_property_read_string(fwnode->secondary,
626626
propname, val);
627627
return ret;

0 commit comments

Comments
 (0)