fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / pci / hotplug / rpadlpar_sysfs.c
index 3285b82..6c5be3f 100644 (file)
@@ -14,7 +14,7 @@
  */
 #include <linux/kobject.h>
 #include <linux/string.h>
-#include "pci_hotplug.h"
+#include <linux/pci_hotplug.h>
 #include "rpadlpar.h"
 
 #define DLPAR_KOBJ_NAME       "control"
@@ -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);