Whamcloud - gitweb
LU-4088 obdecho: Copy entire lsm, not just pointer size 22/7922/2
authorOleg Drokin <oleg.drokin@intel.com>
Fri, 11 Oct 2013 01:17:03 +0000 (21:17 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 2 Dec 2013 23:16:50 +0000 (23:16 +0000)
From linux-kernel upstream:
Author: Thomas Meyer <thomas@m3y3r.de>
Date:   Thu Sep 19 23:45:46 2013 +0200

staging: lustre: Cocci spatch "noderef"

sizeof when applied to a pointer typed expression gives the size of the
pointer.
Found by coccinelle spatch "misc/noderef.cocci"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Change-Id: If5ce3597abe1d2a806c94e34a1b7dc4c27f19e02
Reviewed-on: http://review.whamcloud.com/7922
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdecho/echo_client.c

index a4bef14..0b22468 100644 (file)
@@ -1424,7 +1424,7 @@ echo_copyout_lsm (struct lov_stripe_md *lsm, void *_ulsm, int ulsm_nob)
         if (nob > ulsm_nob)
                 return (-EINVAL);
 
-       if (copy_to_user (ulsm, lsm, sizeof(ulsm)))
+       if (copy_to_user (ulsm, lsm, sizeof(*ulsm)))
                 return (-EFAULT);
 
         for (i = 0; i < lsm->lsm_stripe_count; i++) {