Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281046
b: refs/heads/master
c: d9f26a6
h: refs/heads/master
v: v3
  • Loading branch information
Kevin McKinney authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent 3997f31 commit 92d1760
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: abe33fc0933f9221193fc047fbf93cf9db23c8f6
refs/heads/master: d9f26a6689a3e4ae643fca9c2acda3148b717e63
17 changes: 13 additions & 4 deletions trunk/drivers/staging/bcm/Bcmchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,27 +802,36 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
}

/* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) {
up(&Adapter->fw_download_sema);
return -EFAULT;
}

BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
"Length for FW DLD is : %lx\n", IoBuffer.InputLength);

if (IoBuffer.InputLength > sizeof(FIRMWARE_INFO))
if (IoBuffer.InputLength > sizeof(FIRMWARE_INFO)) {
up(&Adapter->fw_download_sema);
return -EINVAL;
}

psFwInfo = kmalloc(sizeof(*psFwInfo), GFP_KERNEL);
if (!psFwInfo)
if (!psFwInfo) {
up(&Adapter->fw_download_sema);
return -ENOMEM;
}

if (copy_from_user(psFwInfo, IoBuffer.InputBuffer, IoBuffer.InputLength))
if (copy_from_user(psFwInfo, IoBuffer.InputBuffer, IoBuffer.InputLength)) {
up(&Adapter->fw_download_sema);
return -EFAULT;
}

if (!psFwInfo->pvMappedFirmwareAddress ||
(psFwInfo->u32FirmwareLength == 0)) {

BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Something else is wrong %lu\n",
psFwInfo->u32FirmwareLength);
up(&Adapter->fw_download_sema);
Status = -EINVAL;
break;
}
Expand Down

0 comments on commit 92d1760

Please sign in to comment.