staging: lustre: ptlrpc: lproc_ptlrpc.c - fix dereferenceing user space buffer
authorAnil Belur <askb23@gmail.com>
Thu, 31 Jul 2014 07:51:02 +0000 (13:21 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Aug 2014 21:42:51 +0000 (14:42 -0700)
- this fixes sparse warning for directly deferencing user space buffer

drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:652:33: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:652:33:    expected void const [noderef] <asn:1>*from
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:652:33:    got char const *buffer

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c

index 9279215418514ae983fdf8b47c0f762e2b84b65a..bc220308e7d7de2e810f008ecad4137def5e27d9 100644 (file)
@@ -628,7 +628,8 @@ out:
  * if the optional token is omitted, the operation is performed on both the
  * regular and high-priority (if the service has one) NRS head.
  */
-static ssize_t ptlrpc_lprocfs_nrs_seq_write(struct file *file, const char *buffer,
+static ssize_t ptlrpc_lprocfs_nrs_seq_write(struct file *file,
+                                       const char __user *buffer,
                                        size_t count, loff_t *off)
 {
        struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private;