All of
 help / color / mirror / Atom feed
From: Dan Carpenter <>
Subject: [patch] avoid null deref in unpin_extent_cache()
Date: Tue, 10 Nov 2009 11:01:43 +0200 (SAST)	[thread overview]
Message-ID: <alpine.DEB.2.00.0911072313580.30287@bicker> (raw)

I re-orderred the checks to avoid dereferencing "em" if it was null.

Found by smatch static checker.

dan carpenter

Signed-off-by: Dan Carpenter <>

--- orig/fs/btrfs/extent_map.c	2009-11-08 14:01:09.000000000 +0200
+++ devel/fs/btrfs/extent_map.c	2009-11-08 14:01:44.000000000 +0200
@@ -208,7 +208,7 @@
 	em = lookup_extent_mapping(tree, start, len);
-	WARN_ON(em->start != start || !em);
+	WARN_ON(!em || em->start != start);
 	if (!em)
 		goto out;

             reply	other threads:[~2009-11-10  9:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-10  9:01 Dan Carpenter [this message]
2009-11-11 21:26 ` [patch] avoid null deref in unpin_extent_cache() Chris Mason

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:

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

  git send-email \
    --in-reply-to=alpine.DEB.2.00.0911072313580.30287@bicker \ \ \ \

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.