kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: j.neuschaefer@gmx.net (Jonathan Neuschäfer)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Build scatterlist covering a process' text segment?
Date: Fri, 17 Jun 2011 20:46:35 +0200	[thread overview]
Message-ID: <20110617184635.GD1451@debian.debian> (raw)
In-Reply-To: <8B479D44-48BC-464C-B4D6-6CF0F7138E52@gmail.com>

On Fri, Jun 17, 2011 at 06:18:06PM +0300, Metin KAYA wrote:
> Jonathan, it's kmalloc(), not kcalloc().

No, I was trying to suggest using kcalloc(), which behaves roughly like
the userspace calloc, and implements overflow checking, which you may
need and zeroing, which you don't seem to need.

(see include/linux/slab.h, line 223 for reference)

> 
> On 17 Haz 2011, at 18:10, Jonathan Neusch?fer <j.neuschaefer@gmx.net> wrote:
> 
> > On Fri, Jun 17, 2011 at 02:47:25AM +0200, Arvid Brodin wrote:
> > [...]
> >>    /**** User page code ****/
> >> 
> >>    pages = kmalloc(nr_pages * sizeof(*pages), GFP_KERNEL);
> > 
> > kcalloc?
> > 
> > You don't need the zeroing but the overflow check might be useful.
> > 
> >>    if (!pages) {
> >>        retval = -ENOMEM;
> >>        goto err_pages;
> >>    }
> > 
> > Greetings,
> >    Jonathan Neusch?fer

HTH,
	Jonathan Neusch?fer

  parent reply	other threads:[~2011-06-17 18:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 23:06 Build scatterlist covering a process' text segment? Arvid Brodin
2011-05-25 20:27 ` Arvid Brodin
2011-05-26  4:02   ` Mulyadi Santosa
2011-05-27 21:58     ` Arvid Brodin
2011-05-28  9:42       ` Mulyadi Santosa
2011-06-17  0:47         ` Arvid Brodin
2011-06-17 15:10           ` Jonathan Neuschäfer
2011-06-17 15:18             ` Metin KAYA
2011-06-17 17:59               ` Dave Hylands
2011-06-17 18:46               ` Jonathan Neuschäfer [this message]
2011-06-17 18:53                 ` Dave Hylands
2011-06-17 19:00                 ` Jonathan Neuschäfer

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=20110617184635.GD1451@debian.debian \
    --to=j.neuschaefer@gmx.net \
    --cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).