bus/pci: replace strncpy by strlcpy
authorAndy Green <andy@warmcat.com>
Mon, 14 May 2018 05:00:06 +0000 (13:00 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:32:23 +0000 (23:32 +0200)
commitfe5f777b538301ecadf3fee5c30dd0b289f50c7c
treee829260c1311e99945f28872ef40623f35bfd91e
parentf5fd98c802e8911513fff217a01d0a61eba86ff1
bus/pci: replace strncpy by strlcpy

In function ‘pci_get_kernel_driver_by_path’,
    inlined from ‘pci_scan_one.isra.1’ at
drivers/bus/pci/linux/pci.c:317:8:
drivers/bus/pci/linux/pci.c:57:3: error:
‘strncpy’ specified bound depends on the length of the source argument
[-Werror=stringop-overflow=]
   strncpy(dri_name, name + 1, strlen(name + 1) + 1);

Fixes: d9a8cd9595f2 ("pci: add kernel driver type")
Cc: stable@dpdk.org
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
drivers/bus/pci/linux/pci.c