Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[linux-2.6-microblaze.git] / drivers / net / wireless / marvell / mwifiex / debugfs.c
index df28836..bccf17a 100644 (file)
@@ -925,14 +925,12 @@ mwifiex_reset_write(struct file *file,
 {
        struct mwifiex_private *priv = file->private_data;
        struct mwifiex_adapter *adapter = priv->adapter;
-       char cmd;
        bool result;
+       int rc;
 
-       if (copy_from_user(&cmd, ubuf, sizeof(cmd)))
-               return -EFAULT;
-
-       if (strtobool(&cmd, &result))
-               return -EINVAL;
+       rc = kstrtobool_from_user(ubuf, count, &result);
+       if (rc)
+               return rc;
 
        if (!result)
                return -EINVAL;