can: avoids a false warning

Previous thread: e1000e: stop cleaning when we reach tx_ring->next_to_use by Linux Kernel Mailing List on Tuesday, April 13, 2010 - 12:59 pm. (1 message)

Next thread: smc91c92_cs: define multicast_table as unsigned char by Linux Kernel Mailing List on Tuesday, April 13, 2010 - 12:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Tuesday, April 13, 2010 - 12:59 pm

Gitweb:     http://git.kernel.org/linus/4ffa87012efd7b664762b579213d4663560ef4a3
Commit:     4ffa87012efd7b664762b579213d4663560ef4a3
Parent:     dac876193cd79ced36d0462749ea47c05844fb49
Author:     Eric Dumazet <eric.dumazet@gmail.com>
AuthorDate: Fri Apr 9 23:47:31 2010 +0000
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Tue Apr 13 03:03:14 2010 -0700

    can: avoids a false warning
    
    At this point optlen == sizeof(sfilter) but some compilers are dumb.
    
    Reported-by: Németh Márton <nm127@freemail.h
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/can/raw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/can/raw.c b/net/can/raw.c
index 3a7dffb..da99cf1 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -445,7 +445,7 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
 				return -EFAULT;
 			}
 		} else if (count == 1) {
-			if (copy_from_user(&sfilter, optval, optlen))
+			if (copy_from_user(&sfilter, optval, sizeof(sfilter)))
 				return -EFAULT;
 		}
 
--

Previous thread: e1000e: stop cleaning when we reach tx_ring->next_to_use by Linux Kernel Mailing List on Tuesday, April 13, 2010 - 12:59 pm. (1 message)

Next thread: smc91c92_cs: define multicast_table as unsigned char by Linux Kernel Mailing List on Tuesday, April 13, 2010 - 12:59 pm. (1 message)