Advertisement
Outlasted

Untitled

Jun 29th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. if (a->d) {
  2. p = kmalloc(nlimbs * sizeof(mpi_limb_t), GFP_KERNEL);
  3. if (!p)
  4. return -ENOMEM;
  5. memcpy(p, a->d, a->alloced * sizeof(mpi_limb_t));
  6. kzfree(a->d);
  7. a->d = p;
  8. } else {
  9. a->d = kzalloc(nlimbs * sizeof(mpi_limb_t), GFP_KERNEL);
  10. if (!a->d)
  11. return -ENOMEM;
  12. }
  13. a->alloced = nlimbs;
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement