summaryrefslogtreecommitdiff
path: root/drivers/pci/hotplug/rpadlpar_sysfs.c
diff options
context:
space:
mode:
authorAparna Balasubramanian <aparnab@ti.com>2021-04-28 08:51:55 -0500
committerAparna Balasubramanian <aparnab@ti.com>2021-04-28 08:51:55 -0500
commit8b16abca7ed2e69ada253b4c63a9b99bb9133431 (patch)
tree10ab37e4ed1861d32fbc538e9dd713e173345923 /drivers/pci/hotplug/rpadlpar_sysfs.c
parentbdfd5b0c1ee5617c9a94bacad0d818920d95b486 (diff)
parent1e798745fa8ef91ffe4fd38d443f9d44b59e3cb3 (diff)
Merge tag 'v5.10.30' of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux into ti-linux-5.10.y
This is the 5.10.30 stable release * tag 'v5.10.30' of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux: (1106 commits) Linux 5.10.30 Revert "net: sched: bump refcount for new action in ACT replace mode" net: ieee802154: stop dump llsec params for monitors net: ieee802154: forbid monitor for del llsec seclevel net: ieee802154: forbid monitor for set llsec params net: ieee802154: fix nl802154 del llsec devkey net: ieee802154: fix nl802154 add llsec key net: ieee802154: fix nl802154 del llsec dev net: ieee802154: fix nl802154 del llsec key net: ieee802154: nl-mac: fix check on panid net: mac802154: Fix general protection fault drivers: net: fix memory leak in peak_usb_create_dev drivers: net: fix memory leak in atusb_probe net: tun: set tun->dev->addr_len during TUNSETLINK processing cfg80211: remove WARN_ON() in cfg80211_sme_connect gpiolib: Read "gpio-line-names" from a firmware node net: sched: bump refcount for new action in ACT replace mode dt-bindings: net: ethernet-controller: fix typo in NVMEM lockdep: Address clang -Wformat warning printing for %hd clk: socfpga: fix iomem pointer cast on 64-bit ... Signed-off-by: Aparna Balasubramanian <aparnab@ti.com>
Diffstat (limited to 'drivers/pci/hotplug/rpadlpar_sysfs.c')
-rw-r--r--drivers/pci/hotplug/rpadlpar_sysfs.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/pci/hotplug/rpadlpar_sysfs.c b/drivers/pci/hotplug/rpadlpar_sysfs.c
index cdbfa5df3a51..dbfa0b55d31a 100644
--- a/drivers/pci/hotplug/rpadlpar_sysfs.c
+++ b/drivers/pci/hotplug/rpadlpar_sysfs.c
@@ -34,12 +34,11 @@ static ssize_t add_slot_store(struct kobject *kobj, struct kobj_attribute *attr,
if (nbytes >= MAX_DRC_NAME_LEN)
return 0;
- memcpy(drc_name, buf, nbytes);
+ strscpy(drc_name, buf, nbytes + 1);
end = strchr(drc_name, '\n');
- if (!end)
- end = &drc_name[nbytes];
- *end = '\0';
+ if (end)
+ *end = '\0';
rc = dlpar_add_slot(drc_name);
if (rc)
@@ -65,12 +64,11 @@ static ssize_t remove_slot_store(struct kobject *kobj,
if (nbytes >= MAX_DRC_NAME_LEN)
return 0;
- memcpy(drc_name, buf, nbytes);
+ strscpy(drc_name, buf, nbytes + 1);
end = strchr(drc_name, '\n');
- if (!end)
- end = &drc_name[nbytes];
- *end = '\0';
+ if (end)
+ *end = '\0';
rc = dlpar_remove_slot(drc_name);
if (rc)