Commit c88a3114 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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()
parents bb86d657 73979060
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -997,26 +997,32 @@ struct fwnode_handle *
fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
			       struct fwnode_handle *prev)
{
	struct fwnode_handle *ep, *port_parent = NULL;
	const struct fwnode_handle *parent;
	struct fwnode_handle *ep;

	/*
	 * If this function is in a loop and the previous iteration returned
	 * an endpoint from fwnode->secondary, then we need to use the secondary
	 * as parent rather than @fwnode.
	 */
	if (prev)
		parent = fwnode_graph_get_port_parent(prev);
	else
	if (prev) {
		port_parent = fwnode_graph_get_port_parent(prev);
		parent = port_parent;
	} else {
		parent = fwnode;
	}
	if (IS_ERR_OR_NULL(parent))
		return NULL;

	ep = fwnode_call_ptr_op(parent, graph_get_next_endpoint, prev);
	if (ep)
		return ep;
		goto out_put_port_parent;

	return fwnode_graph_get_next_endpoint(parent->secondary, NULL);
	ep = fwnode_graph_get_next_endpoint(parent->secondary, NULL);

out_put_port_parent:
	fwnode_handle_put(port_parent);
	return ep;
}
EXPORT_SYMBOL_GPL(fwnode_graph_get_next_endpoint);

+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ static int __init test_async_probe_init(void)
	calltime = ktime_get();
	for_each_online_cpu(cpu) {
		nid = cpu_to_node(cpu);
		pdev = &sync_dev[sync_id];
		pdev = &async_dev[async_id];

		*pdev = test_platform_device_register_node("test_async_driver",
							   async_id,
+2 −0
Original line number Diff line number Diff line
@@ -1442,6 +1442,8 @@ static int do_prlimit(struct task_struct *tsk, unsigned int resource,

	if (resource >= RLIM_NLIMITS)
		return -EINVAL;
	resource = array_index_nospec(resource, RLIM_NLIMITS);

	if (new_rlim) {
		if (new_rlim->rlim_cur > new_rlim->rlim_max)
			return -EINVAL;