net: macvtap: fix template string argument of device_create() call
authorJean Sacren <sakiwit@gmail.com>
Sat, 16 Oct 2021 05:41:34 +0000 (23:41 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 Oct 2021 07:51:21 +0000 (08:51 +0100)
The last argument of device_create() call should be a template string.
The tap_name variable should be the argument to the string, but not the
argument of the call itself.  We should add the template string and turn
tap_name into its argument.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvtap.c

index 694e2f5..6b12902 100644 (file)
@@ -169,7 +169,7 @@ static int macvtap_device_event(struct notifier_block *unused,
 
                devt = MKDEV(MAJOR(macvtap_major), vlantap->tap.minor);
                classdev = device_create(&macvtap_class, &dev->dev, devt,
-                                        dev, tap_name);
+                                        dev, "%s", tap_name);
                if (IS_ERR(classdev)) {
                        tap_free_minor(macvtap_major, &vlantap->tap);
                        return notifier_from_errno(PTR_ERR(classdev));