public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Erez Zadok <ezk@cs.sunysb.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Ulrich Drepper <drepper@redhat.com>,
	Roland McGrath <roland@redhat.com>,
	"Andrew G. Morgan" <morgan@kernel.org>,
	Casey Schaufler <casey@schaufler-ca.com>,
	Chris Wright <chrisw@sous-sol.org>,
	James Morris <jmorris@namei.org>, Serge Hallyn <serue@us.ibm.com>,
	Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [PATCH] kernel/capability.c get_task_comm compile error (MMOTM)
Date: Sun, 11 Nov 2007 21:44:19 +0100	[thread overview]
Message-ID: <20071111204419.GA18829@elte.hu> (raw)
In-Reply-To: <200711111711.lABHB7xo002409@agora.fsl.cs.sunysb.edu>


* Erez Zadok <ezk@cs.sunysb.edu> wrote:

> Ingo, I don't see how it can return NULL.  This is what get_task_comm 
> looks like in MMOTM-2007-11-10-19-05:
> 
> char *get_task_comm(char *buf, struct task_struct *tsk)
> {
> 	/* buf must be at least sizeof(tsk->comm) in size */
> 	task_lock(tsk);
> 	strncpy(buf, tsk->comm, sizeof(tsk->comm));
> 	task_unlock(tsk);
> 	return buf;
> }
> 
> The only way it'd return NULL is if a null buf was passed, in which 
> case the strncpy will oops first.

hm, here it says in include/linux/sched.h:

 extern void get_task_comm(char *to, struct task_struct *tsk);

HEAD ecd744eec3a.

	Ingo

  reply	other threads:[~2007-11-11 20:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-11  1:01 [PATCH] kernel/capability.c get_task_comm compile error (MMOTM) Erez Zadok
2007-11-11 14:15 ` Ingo Molnar
2007-11-11 17:11   ` Erez Zadok
2007-11-11 20:44     ` Ingo Molnar [this message]
2007-11-11 19:30   ` Andrew Morton

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=20071111204419.GA18829@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=casey@schaufler-ca.com \
    --cc=chrisw@sous-sol.org \
    --cc=drepper@redhat.com \
    --cc=ezk@cs.sunysb.edu \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=morgan@kernel.org \
    --cc=roland@redhat.com \
    --cc=sds@tycho.nsa.gov \
    --cc=serue@us.ibm.com \
    /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