mirror of https://gitee.com/openkylin/linux.git
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
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue