Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0daf17b9 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

greybus: connection: fix potential null-deref on create



Make sure that the interface lookup helper can handle static,
bundle-less connections without oopsing when creating further
connections.

Note that the initial svc-connection has always been bundle-less, but
did not trigger an oops as a bundle was created for it before further
connections were created.

Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 2566fae6
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -20,10 +20,12 @@ gb_connection_intf_find(struct gb_interface *intf, u16 cport_id)
	struct gb_host_device *hd = intf->hd;
	struct gb_connection *connection;

	list_for_each_entry(connection, &hd->connections, hd_links)
		if (connection->bundle->intf == intf &&
	list_for_each_entry(connection, &hd->connections, hd_links) {
		if (connection->intf == intf &&
				connection->intf_cport_id == cport_id)
			return connection;
	}

	return NULL;
}