net: qualcomm: rmnet: Allow only one rmnet dev per muxid per real dev
authorSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Tue, 12 Dec 2017 00:30:12 +0000 (17:30 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Dec 2017 19:01:08 +0000 (14:01 -0500)
Upon de-multiplexing data from one real dev, the packets can be sent
to an unique rmnet device for a given mux id.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c

index 9caa5e387450933ebb1c963da14dd5042b45f2f7..5bb29f44d114a53adca1b6b04084560e7928d6b0 100644 (file)
@@ -185,6 +185,9 @@ int rmnet_vnd_newlink(u8 id, struct net_device *rmnet_dev,
        if (ep->egress_dev)
                return -EINVAL;
 
+       if (rmnet_get_endpoint(port, id))
+               return -EBUSY;
+
        rc = register_netdevice(rmnet_dev);
        if (!rc) {
                ep->egress_dev = rmnet_dev;