isdn: mISDN: socket: Fix set-but-unused variables.

The variable 'len' is set but unused in data_sock_getsockopt().

The code should use 'len' to validate that the user's socket option is
indeed the right size.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2011-04-17 16:48:53 -07:00
parent 07f46f80f4
commit 81b424d9e2
1 changed files with 3 additions and 0 deletions

View File

@ -457,6 +457,9 @@ static int data_sock_getsockopt(struct socket *sock, int level, int optname,
if (get_user(len, optlen)) if (get_user(len, optlen))
return -EFAULT; return -EFAULT;
if (len != sizeof(char))
return -EINVAL;
switch (optname) { switch (optname) {
case MISDN_TIME_STAMP: case MISDN_TIME_STAMP:
if (_pms(sk)->cmask & MISDN_TIME_STAMP) if (_pms(sk)->cmask & MISDN_TIME_STAMP)