I am working on this piece of code (simplified):

void ip_vma(struct task_struct *task, struct pt_regs *regs)
struct mm_struct *mm;
struct vm_area_struct *vma;

if(task) {
mm = get_task_mm(task);
if(mm) {
vma = find_vma(mm, regs->eip);
if(vma) {
/* Some code */
printk("WARNING: No VMA\n");

I would like to get instruction pointer's VMA of a task. In order to do so, I
use find_vma function, using regs->eip as instruction pointer value.
Unfortunately I always get "WARNING: No VMA" message because find_vma isn't able
to find the right VMA regs->eip address belongs to.
Is regs->eip the right place where istruction pointer is located or I should
find that value elsewhere?

Thank you,