lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 27 Jan 2010 14:27:29 +0800
From:	Liuwenyi <qingshenlwy@...il.com>
To:	chris.mason@...cle.com, zheng.yan@...cle.com, jbacik@...hat.com,
	jens.axboe@...cle.com, linux-btrfs <linux-btrfs@...r.kernel.org>,
	linux-kernel@...r.kernel.org, strongzgy@...il.com
Subject: [PATCH]btrfs: avoid comparing with NULL pointer

In this patch, I adjust the seqence of if-conditions.
It will assess the page->private situation.
First, we make sure the page->private is not null.
And then, we can do some with this page->private.

---
Signed-off-by: Liuwenyi <qingshenlwy@...il.com>
Cc: Chris Mason <chris.mason@...cle.com>
Cc: Yan Zheng <zheng.yan@...cle.com>
Cc: Josef Bacik <jbacik@...hat.com>
Cc: Jens Axboe <jens.axboe@...cle.com>
Cc: linux-btrfs@...r.kernel.org
Cc: linux-kernel@...r.kernel.org

---
fs/btrfs/disk-io.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 009e3bd..a300dca 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1407,11 +1407,11 @@ static int bio_ready_for_csum(struct bio *bio)

bio_for_each_segment(bvec, bio, i) {
page = bvec->bv_page;
- if (page->private == EXTENT_PAGE_PRIVATE) {
+ if (!page->private) {
length += bvec->bv_len;
continue;
}
- if (!page->private) {
+ if (page->private == EXTENT_PAGE_PRIVATE) {
length += bvec->bv_len;
continue;
}
-- 
1.6.6


---
Best Regards,
Liuwenyi
2010-01-277
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ