Look up the connection that an incoming message is associated with.
This is the start of making message handling oriented toward the
the connection rather than the cport.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
{
struct gb_cport_handler *ch;
struct gbuf *gbuf;
+ struct gb_connection *connection;
+
+ connection = gb_hd_connection_find(hd, cport_id);
+ if (!connection) {
+ dev_err(hd->parent,
+ "nonexistent connection (%zu bytes dropped)\n", length);
+ return;
+ }
/* first check to see if we have a cport handler for this cport */
ch = &cport_handler[cport_id];