mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "jidong xiao" <jidong.xiao@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Question on IS_ERR
Date: Thu, 9 Aug 2007 13:36:45 +0800	[thread overview]
Message-ID: <4104961b0708082236if0c1199l2bbc468e9d582a08@mail.gmail.com> (raw)

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

             reply	other threads:[~2007-08-09  5:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-09  5:36 jidong xiao [this message]
2007-08-09  6:13 ` H. Peter Anvin
2007-08-09  6:31   ` jidong xiao
2007-08-09  7:21     ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4104961b0708082236if0c1199l2bbc468e9d582a08@mail.gmail.com \
    --to=jidong.xiao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®