···364 /* Allocate a new rectangle optimistically. */365 rect = kmalloc(sizeof(struct hardwall_info),366 GFP_KERNEL | __GFP_ZERO);00367 INIT_LIST_HEAD(&rect->task_head);368369 /* Compute the rectangle size and validate that it's plausible. */
···364 /* Allocate a new rectangle optimistically. */365 rect = kmalloc(sizeof(struct hardwall_info),366 GFP_KERNEL | __GFP_ZERO);367+ if (rect == NULL)368+ return ERR_PTR(-ENOMEM);369 INIT_LIST_HEAD(&rect->task_head);370371 /* Compute the rectangle size and validate that it's plausible. */