diff options
author | Kevin McKinney <klmckinney1@gmail.com> | 2011-12-02 03:02:15 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-08 20:42:15 (GMT) |
commit | 09468b0392b1d2b079b334d60a23d7da8105dc53 (patch) | |
tree | b073e5bad8d90cc1a02a0a6ccca5732efab41ac2 /drivers/staging/bcm/Bcmchar.c | |
parent | 4c6fb5fc050a4430363d92994132fffa6776c9d4 (diff) | |
download | linux-fsl-qoriq-09468b0392b1d2b079b334d60a23d7da8105dc53.tar.xz |
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>
Diffstat (limited to 'drivers/staging/bcm/Bcmchar.c')
-rw-r--r-- | drivers/staging/bcm/Bcmchar.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c index 72a699c..ad1cc55 100644 --- a/drivers/staging/bcm/Bcmchar.c +++ b/drivers/staging/bcm/Bcmchar.c @@ -1336,7 +1336,7 @@ cntrlEnd: if (copy_to_user(stNVMReadWrite.pBuffer, pReadData, stNVMReadWrite.uiNumBytes)) { kfree(pReadData); - Status = -EFAULT; + return -EFAULT; } } else { down(&Adapter->NVMRdmWrmLock); |