public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Question on IS_ERR
@ 2007-08-09  5:36 jidong xiao
  2007-08-09  6:13 ` H. Peter Anvin
  0 siblings, 1 reply; 4+ messages in thread
From: jidong xiao @ 2007-08-09  5:36 UTC (permalink / raw)
  To: linux-kernel

I saw we call IS_ERR(ptr) after executing kthread_run() each time.
But we don't need to call IS_ERR(ptr) after kmalloc().

My understanding is,
the kernel pointer ptr for IS_ERR to check should be page aligned, so
its kernel address should be less than 0xfffff000(or 0xffff ffff ffff
f000, 64bits),

kthread_run returns a struct task_struct pointer,which is always page aligned,
however the pointer returned by kmalloc() might not be page aligned,
so we cannot use IS_ERR to check.

Is my understanding correct?

Thanks
Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-09  7:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-09  5:36 Question on IS_ERR jidong xiao
2007-08-09  6:13 ` H. Peter Anvin
2007-08-09  6:31   ` jidong xiao
2007-08-09  7:21     ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox