The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
Please vote in the Forum Structure Poll. Polling will close at 2PM EST on January 21, 2025.
Anyone here familiar with kernel programming? Having an issue where kmalloc seems to be unable to allocate memory. Here's the relevant code:
if (array != NULL ) {
kfree (array);
}
array = kmalloc (size * sizeof(char), GFP_KERNEL);
if ( KS421 == NULL ) {
printk ("Error: kmalloc failed to give memory\n");
return -ENOMEM;
}
The error condition triggers every time. Removing it results in a segmentation fault, so it seems to be accurate. Anything wrong with how I'm allocating memory? I find it hard to believe that I'd have no memory available to give to an array of three characters (my test case).