ntb: avoid format string in dev_set_name
authorKees Cook <keescook@chromium.org>
Fri, 24 Jul 2015 23:35:59 +0000 (16:35 -0700)
committerJon Mason <jdmason@kudzu.us>
Sun, 9 Aug 2015 20:32:22 +0000 (16:32 -0400)
Avoid any chance of format string expansion when calling dev_set_name.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/ntb.c

index 23435f2..2e25307 100644 (file)
@@ -114,7 +114,7 @@ int ntb_register_device(struct ntb_dev *ntb)
        ntb->dev.bus = &ntb_bus;
        ntb->dev.parent = &ntb->pdev->dev;
        ntb->dev.release = ntb_dev_release;
-       dev_set_name(&ntb->dev, pci_name(ntb->pdev));
+       dev_set_name(&ntb->dev, "%s", pci_name(ntb->pdev));
 
        ntb->ctx = NULL;
        ntb->ctx_ops = NULL;