From: Oliver Hartkopp Date: Sat, 2 Dec 2017 17:48:52 +0000 (+0100) Subject: can: vxcan: improve handling of missing peer name attribute X-Git-Tag: v4.19~1869^2~7^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4c2951a4833e66f1bbfe65ddcd4fdcdfafe5e8f;p=platform%2Fkernel%2Flinux-rpi3.git can: vxcan: improve handling of missing peer name attribute Picking up the patch from Serhey Popovych (commit 191cdb3822e5df6b3c8, "veth: Be more robust on network device creation when no attributes"). When the peer name attribute is not provided the former implementation tries to register the given device name twice ... which leads to -EEXIST. If only one device name is given apply an automatic generated and valid name for the peer. Cc: Serhey Popovych Signed-off-by: Oliver Hartkopp Cc: linux-stable Signed-off-by: Marc Kleine-Budde --- diff --git a/drivers/net/can/vxcan.c b/drivers/net/can/vxcan.c index 8404e88..b4c4a2c 100644 --- a/drivers/net/can/vxcan.c +++ b/drivers/net/can/vxcan.c @@ -194,7 +194,7 @@ static int vxcan_newlink(struct net *net, struct net_device *dev, tbp = peer_tb; } - if (tbp[IFLA_IFNAME]) { + if (ifmp && tbp[IFLA_IFNAME]) { nla_strlcpy(ifname, tbp[IFLA_IFNAME], IFNAMSIZ); name_assign_type = NET_NAME_USER; } else {