Skip to content

Commit

Permalink
Staging: bcm: avoid use-after-free in bcm_char_ioctl()
Browse files Browse the repository at this point in the history
Free pBulkBuffer (pvBuffer) after pBulkBuffer->Register.

Signed-off-by: Xi Wang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
xiw authored and gregkh committed Mar 11, 2013
1 parent eb1bd49 commit 075dd9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/bcm/Bcmchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,8 +1148,8 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)

if (((ULONG)pBulkBuffer->Register & 0x0F000000) != 0x0F000000 ||
((ULONG)pBulkBuffer->Register & 0x3)) {
kfree(pvBuffer);
BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "WRM Done On invalid Address : %x Access Denied.\n", (int)pBulkBuffer->Register);
kfree(pvBuffer);
Status = -EINVAL;
break;
}
Expand Down

0 comments on commit 075dd9b

Please sign in to comment.