public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: Dawson Engler <engler@csl.Stanford.EDU>
Cc: linux-kernel@vger.kernel.org, mc@cs.Stanford.EDU
Subject: Re: [CHECKER] 54 missing null pointer checks in 2.4.17
Date: Sun, 9 Jun 2002 23:28:07 -0600	[thread overview]
Message-ID: <20020610052807.GB20388@turbolinux.com> (raw)
In-Reply-To: <200206100355.UAA17040@csl.Stanford.EDU>

On Jun 09, 2002  20:55 -0700, Dawson Engler wrote:
> 2	|	/fs/dcache.c
> 1	|	/fs/sysctl.c
> 
> /u2/engler/mc/oses/linux/2.4.17/fs/intermezzo/dcache.c
> /u2/engler/mc/oses/linux/2.4.17/fs/intermezzo/sysctl.c

It looks like you are dropping part of the path out of the short list.
There is a file fs/dcache.c, but also fs/intermezzo/dcache.c where the
error is shown.  I have passed these errors on to the InterMezzo mailing
list.

> /u2/engler/mc/oses/linux/2.4.17/fs/jbd/journal.c
> 	 * Do we need to do a data copy?
> 	 */
> 
> 	if (need_copy_out && !done_copy_out) {
> 		char *tmp;
> Start --->
> 		tmp = jbd_rep_kmalloc(jh2bh(jh_in)->b_size, GFP_NOFS);
> 
> 		jh_in->b_frozen_data = tmp;
> Error --->
> 		memcpy (tmp, mapped_data, jh2bh(jh_in)->b_size);

Note that jbd_rep_kmalloc() is a special case, and will not currently
return NULL.  This macro calls  __jbd_rep_kmalloc(..., retry=1) which
means "repeat the allocation until it succeeds" so the code path
"if (!retry) return NULL" can never actually happen from this caller.
The logic is somewhat convoluted, so it is not surprising that the
checker didn't distinguish this case (it would have to have done the
"constant" evaluation to drop the NULL return path from the code).

Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/


  parent reply	other threads:[~2002-06-10  5:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-10  3:55 [CHECKER] 54 missing null pointer checks in 2.4.17 Dawson Engler
2002-06-10  5:22 ` Kasper Dupont
2002-06-10  5:56   ` Dawson Engler
2002-06-10  5:28 ` Andreas Dilger [this message]
2002-06-10  6:07   ` Dawson Engler
2002-06-10  6:35     ` Andreas Dilger
2002-06-10  7:05       ` Dawson Engler
2002-06-10  7:19     ` Giuliano Pochini
2002-06-10 12:40       ` john slee
2002-06-10  7:03 ` Brad Hards
2002-06-10  7:08   ` Dawson Engler
2002-06-11  0:30 ` Greg KH

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=20020610052807.GB20388@turbolinux.com \
    --to=adilger@clusterfs.com \
    --cc=engler@csl.Stanford.EDU \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mc@cs.Stanford.EDU \
    /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