Skip to content

Commit c88a311

Browse files
committed
Merge tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg KH: "Here are three small driver and kernel core fixes for 6.2-rc5. They include: - potential gadget fixup in do_prlimit - device property refcount leak fix - test_async_probe bugfix for reported problem" * tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: prlimit: do_prlimit needs to have a speculation check driver core: Fix test_async_probe_init saves device in wrong array device property: fix of node refcount leak in fwnode_graph_get_next_endpoint()
2 parents bb86d65 + 7397906 commit c88a311

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

drivers/base/property.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -997,26 +997,32 @@ struct fwnode_handle *
997997
fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
998998
struct fwnode_handle *prev)
999999
{
1000+
struct fwnode_handle *ep, *port_parent = NULL;
10001001
const struct fwnode_handle *parent;
1001-
struct fwnode_handle *ep;
10021002

10031003
/*
10041004
* If this function is in a loop and the previous iteration returned
10051005
* an endpoint from fwnode->secondary, then we need to use the secondary
10061006
* as parent rather than @fwnode.
10071007
*/
1008-
if (prev)
1009-
parent = fwnode_graph_get_port_parent(prev);
1010-
else
1008+
if (prev) {
1009+
port_parent = fwnode_graph_get_port_parent(prev);
1010+
parent = port_parent;
1011+
} else {
10111012
parent = fwnode;
1013+
}
10121014
if (IS_ERR_OR_NULL(parent))
10131015
return NULL;
10141016

10151017
ep = fwnode_call_ptr_op(parent, graph_get_next_endpoint, prev);
10161018
if (ep)
1017-
return ep;
1019+
goto out_put_port_parent;
1020+
1021+
ep = fwnode_graph_get_next_endpoint(parent->secondary, NULL);
10181022

1019-
return fwnode_graph_get_next_endpoint(parent->secondary, NULL);
1023+
out_put_port_parent:
1024+
fwnode_handle_put(port_parent);
1025+
return ep;
10201026
}
10211027
EXPORT_SYMBOL_GPL(fwnode_graph_get_next_endpoint);
10221028

drivers/base/test/test_async_driver_probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static int __init test_async_probe_init(void)
145145
calltime = ktime_get();
146146
for_each_online_cpu(cpu) {
147147
nid = cpu_to_node(cpu);
148-
pdev = &sync_dev[sync_id];
148+
pdev = &async_dev[async_id];
149149

150150
*pdev = test_platform_device_register_node("test_async_driver",
151151
async_id,

kernel/sys.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,6 +1442,8 @@ static int do_prlimit(struct task_struct *tsk, unsigned int resource,
14421442

14431443
if (resource >= RLIM_NLIMITS)
14441444
return -EINVAL;
1445+
resource = array_index_nospec(resource, RLIM_NLIMITS);
1446+
14451447
if (new_rlim) {
14461448
if (new_rlim->rlim_cur > new_rlim->rlim_max)
14471449
return -EINVAL;

0 commit comments

Comments
 (0)