X-Git-Url: http://git.onelab.eu/?p=linux-2.6.git;a=blobdiff_plain;f=drivers%2Fpci%2Fhotplug%2Frpadlpar_sysfs.c;fp=drivers%2Fpci%2Fhotplug%2Frpadlpar_sysfs.c;h=db69be85b4583100907368d580d03c35779a7576;hp=3285b822478da67bed4fe5672ae44a5939bc0e4e;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hpb=cee37fe97739d85991964371c1f3a745c00dd236 diff --git a/drivers/pci/hotplug/rpadlpar_sysfs.c b/drivers/pci/hotplug/rpadlpar_sysfs.c index 3285b8224..db69be85b 100644 --- a/drivers/pci/hotplug/rpadlpar_sysfs.c +++ b/drivers/pci/hotplug/rpadlpar_sysfs.c @@ -48,7 +48,7 @@ dlpar_attr_store(struct kobject * kobj, struct attribute * attr, struct dlpar_io_attr *dlpar_attr = container_of(attr, struct dlpar_io_attr, attr); return dlpar_attr->store ? - dlpar_attr->store(dlpar_attr, buf, nbytes) : 0; + dlpar_attr->store(dlpar_attr, buf, nbytes) : -EIO; } static struct sysfs_ops dlpar_attr_sysfs_ops = { @@ -62,7 +62,7 @@ static ssize_t add_slot_store(struct dlpar_io_attr *dlpar_attr, char drc_name[MAX_DRC_NAME_LEN]; char *end; - if (nbytes > MAX_DRC_NAME_LEN) + if (nbytes >= MAX_DRC_NAME_LEN) return 0; memcpy(drc_name, buf, nbytes); @@ -83,7 +83,7 @@ static ssize_t remove_slot_store(struct dlpar_io_attr *dlpar_attr, char drc_name[MAX_DRC_NAME_LEN]; char *end; - if (nbytes > MAX_DRC_NAME_LEN) + if (nbytes >= MAX_DRC_NAME_LEN) return 0; memcpy(drc_name, buf, nbytes);