Staging: bcm: avoid use-after-free in bcm_char_ioctl()
Free pBulkBuffer (pvBuffer) after pBulkBuffer->Register. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
eb1bd49c50
commit
075dd9b83d
1 changed files with 1 additions and 1 deletions
|
@ -1148,8 +1148,8 @@ cntrlEnd:
|
||||||
|
|
||||||
if (((ULONG)pBulkBuffer->Register & 0x0F000000) != 0x0F000000 ||
|
if (((ULONG)pBulkBuffer->Register & 0x0F000000) != 0x0F000000 ||
|
||||||
((ULONG)pBulkBuffer->Register & 0x3)) {
|
((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);
|
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;
|
Status = -EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue