Staging: bcm: Fix double free of 'pReadData' in IOCTL_BCM_NVM_WRITE.
This patch fixes a memory error in ioctl, IOCTL_BCM_NVM_WRITE. While copying data to user space, if an error occurs, pReadData is freed. Then, at the end of the ioctl, pReadData was being freed again. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
4c6fb5fc05
commit
09468b0392
|
@ -1336,7 +1336,7 @@ cntrlEnd:
|
|||
|
||||
if (copy_to_user(stNVMReadWrite.pBuffer, pReadData, stNVMReadWrite.uiNumBytes)) {
|
||||
kfree(pReadData);
|
||||
Status = -EFAULT;
|
||||
return -EFAULT;
|
||||
}
|
||||
} else {
|
||||
down(&Adapter->NVMRdmWrmLock);
|
||||
|
|
Loading…
Reference in New Issue