Re: [PATCH] btrfs: fix potential null pointer dereference bug

2013-01-24 Thread Cong Ding
have a better solution? Thanks, - cong >From 3a5b4df67dd177b7cbc61c555349fd7e87ef6b54 Mon Sep 17 00:00:00 2001 From: Cong Ding Date: Thu, 24 Jan 2013 18:30:45 -0500 Subject: [PATCH] btrfs: fix potential null pointer dereference bug The bug happens when rb_node == NULL. It causes variable node t

Re: [PATCH] btrfs: fix potential null pointer dereference bug

2013-01-24 Thread Josef Bacik
On Sat, Jan 19, 2013 at 08:27:45AM -0700, Cong Ding wrote: > The bug happens when rb_node == NULL. It causes variable node to be NULL and > then the NULL pointer is dereferenced this line: > BUG_ON((struct btrfs_root *)node->data != root); > > Based on my analysis, function tree_search shoul

[PATCH] btrfs: fix potential null pointer dereference bug

2013-01-19 Thread Cong Ding
The bug happens when rb_node == NULL. It causes variable node to be NULL and then the NULL pointer is dereferenced this line: BUG_ON((struct btrfs_root *)node->data != root); Based on my analysis, function tree_search should not return NULL to variable rb_node in this case (otherwise here