diff options
| author | Anton Altaparmakov <anton@tuxera.com> | 2012-02-22 06:15:43 -0500 |
|---|---|---|
| committer | Anton Altaparmakov <anton@tuxera.com> | 2012-02-22 06:15:43 -0500 |
| commit | 45d95bcd7ac961eef26374a0ad6100cda55bcea1 (patch) | |
| tree | 85269187088b5c26159fed7ab31068b017027fdc | |
| parent | 0e37579506b9e0c11a4a95c8df6b156b2d6ccf9b (diff) | |
NTFS: Do not dereference pointer before checking for NULL.
Found by Coverity software (http://scan.coverity.com).
Signed-off-by: Anton Altaparmakov <anton@tuxera.com>
| -rw-r--r-- | fs/ntfs/attrib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c index f14fde2b03d6..e0281992ddc3 100644 --- a/fs/ntfs/attrib.c +++ b/fs/ntfs/attrib.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /** | 1 | /** |
| 2 | * attrib.c - NTFS attribute operations. Part of the Linux-NTFS project. | 2 | * attrib.c - NTFS attribute operations. Part of the Linux-NTFS project. |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2001-2007 Anton Altaparmakov | 4 | * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc. |
| 5 | * Copyright (c) 2002 Richard Russon | 5 | * Copyright (c) 2002 Richard Russon |
| 6 | * | 6 | * |
| 7 | * This program/include file is free software; you can redistribute it and/or | 7 | * This program/include file is free software; you can redistribute it and/or |
| @@ -345,10 +345,10 @@ LCN ntfs_attr_vcn_to_lcn_nolock(ntfs_inode *ni, const VCN vcn, | |||
| 345 | unsigned long flags; | 345 | unsigned long flags; |
| 346 | bool is_retry = false; | 346 | bool is_retry = false; |
| 347 | 347 | ||
| 348 | BUG_ON(!ni); | ||
| 348 | ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, %s_locked.", | 349 | ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, %s_locked.", |
| 349 | ni->mft_no, (unsigned long long)vcn, | 350 | ni->mft_no, (unsigned long long)vcn, |
| 350 | write_locked ? "write" : "read"); | 351 | write_locked ? "write" : "read"); |
| 351 | BUG_ON(!ni); | ||
| 352 | BUG_ON(!NInoNonResident(ni)); | 352 | BUG_ON(!NInoNonResident(ni)); |
| 353 | BUG_ON(vcn < 0); | 353 | BUG_ON(vcn < 0); |
| 354 | if (!ni->runlist.rl) { | 354 | if (!ni->runlist.rl) { |
| @@ -469,9 +469,9 @@ runlist_element *ntfs_attr_find_vcn_nolock(ntfs_inode *ni, const VCN vcn, | |||
| 469 | int err = 0; | 469 | int err = 0; |
| 470 | bool is_retry = false; | 470 | bool is_retry = false; |
| 471 | 471 | ||
| 472 | BUG_ON(!ni); | ||
| 472 | ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, with%s ctx.", | 473 | ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, with%s ctx.", |
| 473 | ni->mft_no, (unsigned long long)vcn, ctx ? "" : "out"); | 474 | ni->mft_no, (unsigned long long)vcn, ctx ? "" : "out"); |
| 474 | BUG_ON(!ni); | ||
| 475 | BUG_ON(!NInoNonResident(ni)); | 475 | BUG_ON(!NInoNonResident(ni)); |
| 476 | BUG_ON(vcn < 0); | 476 | BUG_ON(vcn < 0); |
| 477 | if (!ni->runlist.rl) { | 477 | if (!ni->runlist.rl) { |
