mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-05 00:48:08 +02:00
kmalloc --> DRM_MALLOC
This commit is contained in:
parent
d437905d7f
commit
1bd9460733
2 changed files with 8 additions and 12 deletions
|
|
@ -44,8 +44,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
|
|||
{
|
||||
/* Maybe cut off the start of an existing block */
|
||||
if (start > p->start) {
|
||||
struct mem_block *newblock = kmalloc(sizeof(*newblock),
|
||||
GFP_KERNEL);
|
||||
struct mem_block *newblock = DRM_MALLOC(sizeof(*newblock));
|
||||
if (!newblock)
|
||||
goto out;
|
||||
newblock->start = start;
|
||||
|
|
@ -61,8 +60,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
|
|||
|
||||
/* Maybe cut off the end of an existing block */
|
||||
if (size < p->size) {
|
||||
struct mem_block *newblock = kmalloc(sizeof(*newblock),
|
||||
GFP_KERNEL);
|
||||
struct mem_block *newblock = DRM_MALLOC(sizeof(*newblock));
|
||||
if (!newblock)
|
||||
goto out;
|
||||
newblock->start = start + size;
|
||||
|
|
@ -146,12 +144,12 @@ static void print_heap( struct mem_block *heap )
|
|||
*/
|
||||
static int init_heap(struct mem_block **heap, int start, int size)
|
||||
{
|
||||
struct mem_block *blocks = kmalloc(sizeof(*blocks), GFP_KERNEL);
|
||||
struct mem_block *blocks = DRM_MALLOC(sizeof(*blocks));
|
||||
|
||||
if (!blocks)
|
||||
return -ENOMEM;
|
||||
|
||||
*heap = kmalloc(sizeof(**heap), GFP_KERNEL);
|
||||
*heap = DRM_MALLOC(sizeof(**heap));
|
||||
if (!*heap) {
|
||||
kfree( blocks );
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -44,8 +44,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
|
|||
{
|
||||
/* Maybe cut off the start of an existing block */
|
||||
if (start > p->start) {
|
||||
struct mem_block *newblock = kmalloc(sizeof(*newblock),
|
||||
GFP_KERNEL);
|
||||
struct mem_block *newblock = DRM_MALLOC(sizeof(*newblock));
|
||||
if (!newblock)
|
||||
goto out;
|
||||
newblock->start = start;
|
||||
|
|
@ -61,8 +60,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
|
|||
|
||||
/* Maybe cut off the end of an existing block */
|
||||
if (size < p->size) {
|
||||
struct mem_block *newblock = kmalloc(sizeof(*newblock),
|
||||
GFP_KERNEL);
|
||||
struct mem_block *newblock = DRM_MALLOC(sizeof(*newblock));
|
||||
if (!newblock)
|
||||
goto out;
|
||||
newblock->start = start + size;
|
||||
|
|
@ -146,12 +144,12 @@ static void print_heap( struct mem_block *heap )
|
|||
*/
|
||||
static int init_heap(struct mem_block **heap, int start, int size)
|
||||
{
|
||||
struct mem_block *blocks = kmalloc(sizeof(*blocks), GFP_KERNEL);
|
||||
struct mem_block *blocks = DRM_MALLOC(sizeof(*blocks));
|
||||
|
||||
if (!blocks)
|
||||
return -ENOMEM;
|
||||
|
||||
*heap = kmalloc(sizeof(**heap), GFP_KERNEL);
|
||||
*heap = DRM_MALLOC(sizeof(**heap));
|
||||
if (!*heap) {
|
||||
kfree( blocks );
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue