bxe: fix copyin/copyout
authorRon Minnich <rminnich@gmail.com>
Sat, 17 Jan 2015 08:23:42 +0000 (00:23 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 3 Feb 2015 15:12:29 +0000 (10:12 -0500)
Signed-off-by: Ron Minnich <rminnich@gmail.com>
kern/drivers/net/bxe/bxe.c
kern/drivers/net/bxe/bxe.h

index 4a21e69..3cf5b40 100644 (file)
@@ -4538,7 +4538,7 @@ bxe_ioctl_nvram(struct bxe_adapter *sc,
     int len;
     int error = 0;
 
-    copyin(data, &nvdata_base, sizeof(nvdata_base));
+    memcpy_from_user(current, &nvdata_base, data, sizeof(nvdata_base));
 
     len = (sizeof(struct bxe_nvram_data) +
            nvdata_base.len -
@@ -4562,11 +4562,11 @@ bxe_ioctl_nvram(struct bxe_adapter *sc,
                                nvdata->offset,
                                (uint8_t *)nvdata->value,
                                nvdata->len);
-        copyout(nvdata, data, len);
+        memcpy_to_user(current, data, nvdata, len);
     } else { /* BXE_IOC_WR_NVRAM */
         BLOGD(sc, DBG_IOCTL, "IOC_WR_NVRAM 0x%x %d\n",
               nvdata->offset, nvdata->len);
-        copyin(data, nvdata, len);
+        memcpy_from_user(current, nvdata, data, len);
         error = bxe_nvram_write(sc,
                                 nvdata->offset,
                                 (uint8_t *)nvdata->value,
index 93c4061..b792430 100644 (file)
@@ -42,6 +42,7 @@
 #include <bitmap.h>
 #include <taskqueue.h>
 #include <mii.h>
+#include <umem.h>
 
 
 /* MACROS for conversion to AKAROS. Might we want this stuff someday? */