aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/bcm/Bcmchar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c
index c4d7a6194180..fa4a854ba054 100644
--- a/drivers/staging/bcm/Bcmchar.c
+++ b/drivers/staging/bcm/Bcmchar.c
@@ -999,11 +999,15 @@ cntrlEnd:
999 } 999 }
1000 1000
1001 case IOCTL_BCM_GET_DRIVER_VERSION: { 1001 case IOCTL_BCM_GET_DRIVER_VERSION: {
1002 ulong len;
1003
1002 /* Copy Ioctl Buffer structure */ 1004 /* Copy Ioctl Buffer structure */
1003 if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) 1005 if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
1004 return -EFAULT; 1006 return -EFAULT;
1005 1007
1006 if (copy_to_user(IoBuffer.OutputBuffer, VER_FILEVERSION_STR, IoBuffer.OutputLength)) 1008 len = min_t(ulong, IoBuffer.OutputLength, strlen(VER_FILEVERSION_STR) + 1);
1009
1010 if (copy_to_user(IoBuffer.OutputBuffer, VER_FILEVERSION_STR, len))
1007 return -EFAULT; 1011 return -EFAULT;
1008 Status = STATUS_SUCCESS; 1012 Status = STATUS_SUCCESS;
1009 break; 1013 break;