All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] avoid null deref in unpin_extent_cache()
@ 2009-11-10  9:01 Dan Carpenter
  2009-11-11 21:26 ` Chris Mason
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2009-11-10  9:01 UTC (permalink / raw)
  To: chris.mason; +Cc: linux-btrfs

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

Found by smatch static checker.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- 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 @@
 	write_lock(&tree->lock);
 	em = lookup_extent_mapping(tree, start, len);
 
-	WARN_ON(em->start != start || !em);
+	WARN_ON(!em || em->start != start);
 
 	if (!em)
 		goto out;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] avoid null deref in unpin_extent_cache()
  2009-11-10  9:01 [patch] avoid null deref in unpin_extent_cache() Dan Carpenter
@ 2009-11-11 21:26 ` Chris Mason
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Mason @ 2009-11-11 21:26 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-btrfs

On Tue, Nov 10, 2009 at 11:01:43AM +0200, Dan Carpenter wrote:
> I re-orderred the checks to avoid dereferencing "em" if it was null.

Thanks, I've put this into the master branch of the btrfs unstable tree.

-chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-11 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-10  9:01 [patch] avoid null deref in unpin_extent_cache() Dan Carpenter
2009-11-11 21:26 ` Chris Mason

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.