Changeset 18124 in vbox for trunk/src/VBox/Additions/linux/module/vboxmod.c
- Timestamp:
- Mar 20, 2009 9:17:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/module/vboxmod.c
r17962 r18124 71 71 #include <iprt/asm.h> 72 72 #include <iprt/assert.h> 73 #include <iprt/mem.h> 73 74 #include <iprt/memobj.h> 74 75 #include <linux/miscdevice.h> … … 415 416 AssertPtrReturn(pUser, -EINVAL); 416 417 417 pBuf = kmalloc(sizeof(*pBuf), GFP_KERNEL);418 pBuf = RTMemAlloc(sizeof(*pBuf)); 418 419 if (pBuf == NULL) 419 420 rc = -ENOMEM; 420 421 if (rc >= 0) 421 422 { 422 pKernel = kmalloc(cb, GFP_KERNEL);423 pKernel = RTMemAlloc(cb); 423 424 if (pKernel == NULL) 424 425 rc = -ENOMEM; … … 437 438 else 438 439 { 439 kfree(pBuf);440 kfree(pKernel);440 RTMemFree(pBuf); 441 RTMemFree(pKernel); 441 442 LogFunc(("failed, returning %d\n", rc)); 442 443 } … … 451 452 if (copy && copy_to_user(pBuf->pUser, pBuf->pKernel, pBuf->cb) != 0) 452 453 rc = -EFAULT; 453 kfree(pBuf->pKernel); /* We want to do this whatever the outcome. */454 kfree(pBuf);454 RTMemFree(pBuf->pKernel); /* We want to do this whatever the outcome. */ 455 RTMemFree(pBuf); 455 456 if (rc < 0) 456 457 LogFunc(("failed, returning %d\n", rc));
Note:
See TracChangeset
for help on using the changeset viewer.