Skip to content

Commit

Permalink
Automatic merge of 'fixes' into merge (2021-03-17 14:13)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed Mar 17, 2021
2 parents 86db1b2 + cc7a0bb commit 87d76f5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions drivers/pci/hotplug/rpadlpar_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 87d76f5

Please sign in to comment.