Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Net next dpll v14 fix crash #27

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drivers/dpll/dpll_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ dpll_xa_ref_dpll_add(struct xarray *xa_dplls, struct dpll_device *dpll,
return -ENOMEM;
ref->dpll = dpll;
INIT_LIST_HEAD(&ref->registration_list);
ret = xa_insert(xa_dplls, dpll->device_idx, ref, GFP_KERNEL);
ret = xa_insert(xa_dplls, dpll->id, ref, GFP_KERNEL);
if (ret) {
kfree(ref);
return ret;
Expand All @@ -182,7 +182,7 @@ dpll_xa_ref_dpll_add(struct xarray *xa_dplls, struct dpll_device *dpll,
reg = kzalloc(sizeof(*reg), GFP_KERNEL);
if (!reg) {
if (!ref_exists) {
xa_erase(xa_dplls, dpll->device_idx);
xa_erase(xa_dplls, dpll->id);
kfree(ref);
}
return -ENOMEM;
Expand Down
12 changes: 7 additions & 5 deletions drivers/dpll/dpll_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ dpll_pin_state_set(struct dpll_device *dpll, struct dpll_pin *pin,
NL_SET_ERR_MSG(extack, "state changing is not allowed");
return -EOPNOTSUPP;
}
ref = xa_load(&pin->dpll_refs, dpll->device_idx);
ref = xa_load(&pin->dpll_refs, dpll->id);
ASSERT_NOT_NULL(ref);
ops = dpll_pin_ops(ref);
if (!ops->state_on_dpll_set)
Expand All @@ -663,7 +663,7 @@ dpll_pin_prio_set(struct dpll_device *dpll, struct dpll_pin *pin,
NL_SET_ERR_MSG(extack, "prio changing is not allowed");
return -EOPNOTSUPP;
}
ref = xa_load(&pin->dpll_refs, dpll->device_idx);
ref = xa_load(&pin->dpll_refs, dpll->id);
ASSERT_NOT_NULL(ref);
ops = dpll_pin_ops(ref);
if (!ops->prio_set)
Expand Down Expand Up @@ -691,7 +691,7 @@ dpll_pin_direction_set(struct dpll_pin *pin, struct dpll_device *dpll,
NL_SET_ERR_MSG(extack, "direction changing is not allowed");
return -EOPNOTSUPP;
}
ref = xa_load(&pin->dpll_refs, dpll->device_idx);
ref = xa_load(&pin->dpll_refs, dpll->id);
ASSERT_NOT_NULL(ref);
ops = dpll_pin_ops(ref);
if (!ops->direction_set)
Expand Down Expand Up @@ -725,9 +725,11 @@ dpll_pin_parent_device_set(struct dpll_pin *pin, struct nlattr *parent_nest,
}
pdpll_idx = nla_get_u32(tb[DPLL_A_PIN_PARENT_ID]);
dpll = xa_load(&dpll_device_xa, pdpll_idx);
if (!dpll)
if (!dpll) {
NL_SET_ERR_MSG(extack, "parent device not found");
return -EINVAL;
ref = xa_load(&pin->dpll_refs, dpll->device_idx);
}
ref = xa_load(&pin->dpll_refs, dpll->id);
if (!ref) {
NL_SET_ERR_MSG(extack, "pin not connected to given parent device");
return -EINVAL;
Expand Down