As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

Linux programming: kmalloc issues

Steel AngelSteel Angel Registered User regular
edited March 2008 in Help / Advice Forum
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).

Big Dookie wrote: »
I found that tilting it doesn't work very well, and once I started jerking it, I got much better results.

Steam Profile
3DS: 3454-0268-5595 Battle.net: SteelAngel#1772
Steel Angel on
Sign In or Register to comment.