Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281303
b: refs/heads/master
c: 6561f91
h: refs/heads/master
i:
  281301: 5ecd40c
  281299: b62ecfa
  281295: d7b0b2c
v: v3
  • Loading branch information
Kevin McKinney authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent e2e9918 commit f09efa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 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: 09468b0392b1d2b079b334d60a23d7da8105dc53
refs/heads/master: 6561f91d68e6f93cba91e64a3b9e0feba8b84fb8
14 changes: 5 additions & 9 deletions trunk/drivers/staging/bcm/Bcmchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,8 +1269,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
memset(&tv1, 0, sizeof(struct timeval));
if ((Adapter->eNVMType == NVM_FLASH) && (Adapter->uiFlashLayoutMajorVersion == 0)) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "The Flash Control Section is Corrupted. Hence Rejection on NVM Read/Write\n");
Status = -EFAULT;
break;
return -EFAULT;
}

if (IsFlash2x(Adapter)) {
Expand All @@ -1279,7 +1278,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
(Adapter->eActiveDSD != DSD2)) {

BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "No DSD is active..hence NVM Command is blocked");
return STATUS_FAILURE ;
return STATUS_FAILURE;
}
}

Expand All @@ -1298,18 +1297,16 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)

if ((stNVMReadWrite.uiOffset + stNVMReadWrite.uiNumBytes) > Adapter->uiNVMDSDSize) {
/* BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"Can't allow access beyond NVM Size: 0x%x 0x%x\n", stNVMReadWrite.uiOffset, stNVMReadWrite.uiNumBytes); */
Status = STATUS_FAILURE;
break;
return STATUS_FAILURE;
}

pReadData = kzalloc(stNVMReadWrite.uiNumBytes, GFP_KERNEL);
if (!pReadData)
return -ENOMEM;

if (copy_from_user(pReadData, stNVMReadWrite.pBuffer, stNVMReadWrite.uiNumBytes)) {
Status = -EFAULT;
kfree(pReadData);
break;
return -EFAULT;
}

do_gettimeofday(&tv0);
Expand Down Expand Up @@ -1404,9 +1401,8 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, " timetaken by Write/read :%ld msec\n", (tv1.tv_sec - tv0.tv_sec)*1000 + (tv1.tv_usec - tv0.tv_usec)/1000);

kfree(pReadData);
Status = STATUS_SUCCESS;
return STATUS_SUCCESS;
}
break;

case IOCTL_BCM_FLASH2X_SECTION_READ: {
FLASH2X_READWRITE sFlash2xRead = {0};
Expand Down

0 comments on commit f09efa7

Please sign in to comment.