summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/mISDN
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-04-17 16:48:53 -0700
committerDavid S. Miller <davem@davemloft.net>2011-04-17 16:48:53 -0700
commit81b424d9e2ef815b2035d4c2be0bc41dddbebc06 (patch)
tree7b2b1b0cc42a43b6fffac0b1e208c04e3574bfc8 /drivers/isdn/mISDN
parent07f46f80f4ca4ddb700ff40a19876ba1b3242917 (diff)
downloadop-kernel-dev-81b424d9e2ef815b2035d4c2be0bc41dddbebc06.zip
op-kernel-dev-81b424d9e2ef815b2035d4c2be0bc41dddbebc06.tar.gz
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>
Diffstat (limited to 'drivers/isdn/mISDN')
-rw-r--r--drivers/isdn/mISDN/socket.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 7446d8b..8e32522 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -457,6 +457,9 @@ static int data_sock_getsockopt(struct socket *sock, int level, int optname,
if (get_user(len, optlen))
return -EFAULT;
+ if (len != sizeof(char))
+ return -EINVAL;
+
switch (optname) {
case MISDN_TIME_STAMP:
if (_pms(sk)->cmask & MISDN_TIME_STAMP)
OpenPOWER on IntegriCloud