* [PATCH] xfs: fix uninitialized variable in xfs_attr3_leaf_inactive
@ 2020-01-23 15:55 Darrick J. Wong
2020-01-23 16:36 ` Allison Collins
2020-01-23 22:23 ` Eric Sandeen
0 siblings, 2 replies; 3+ messages in thread
From: Darrick J. Wong @ 2020-01-23 15:55 UTC (permalink / raw)
To: linux-xfs; +Cc: Dan Carpenter
From: Darrick J. Wong <darrick.wong@oracle.com>
Dan Carpenter pointed out that error is uninitialized. While there
never should be an attr leaf block with zero entries, let's not leave
that logic bomb there.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/xfs/xfs_attr_inactive.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
index eddd5d311b0c..bbfa6ba84dcd 100644
--- a/fs/xfs/xfs_attr_inactive.c
+++ b/fs/xfs/xfs_attr_inactive.c
@@ -89,7 +89,7 @@ xfs_attr3_leaf_inactive(
struct xfs_attr_leafblock *leaf = bp->b_addr;
struct xfs_attr_leaf_entry *entry;
struct xfs_attr_leaf_name_remote *name_rmt;
- int error;
+ int error = 0;
int i;
xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: fix uninitialized variable in xfs_attr3_leaf_inactive
2020-01-23 15:55 [PATCH] xfs: fix uninitialized variable in xfs_attr3_leaf_inactive Darrick J. Wong
@ 2020-01-23 16:36 ` Allison Collins
2020-01-23 22:23 ` Eric Sandeen
1 sibling, 0 replies; 3+ messages in thread
From: Allison Collins @ 2020-01-23 16:36 UTC (permalink / raw)
To: Darrick J. Wong, linux-xfs; +Cc: Dan Carpenter
On 1/23/20 8:55 AM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Dan Carpenter pointed out that error is uninitialized. While there
> never should be an attr leaf block with zero entries, let's not leave
> that logic bomb there.
>
Looks fine to me.
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/xfs/xfs_attr_inactive.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
> index eddd5d311b0c..bbfa6ba84dcd 100644
> --- a/fs/xfs/xfs_attr_inactive.c
> +++ b/fs/xfs/xfs_attr_inactive.c
> @@ -89,7 +89,7 @@ xfs_attr3_leaf_inactive(
> struct xfs_attr_leafblock *leaf = bp->b_addr;
> struct xfs_attr_leaf_entry *entry;
> struct xfs_attr_leaf_name_remote *name_rmt;
> - int error;
> + int error = 0;
> int i;
>
> xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: fix uninitialized variable in xfs_attr3_leaf_inactive
2020-01-23 15:55 [PATCH] xfs: fix uninitialized variable in xfs_attr3_leaf_inactive Darrick J. Wong
2020-01-23 16:36 ` Allison Collins
@ 2020-01-23 22:23 ` Eric Sandeen
1 sibling, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2020-01-23 22:23 UTC (permalink / raw)
To: Darrick J. Wong, linux-xfs; +Cc: Dan Carpenter
On 1/23/20 9:55 AM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Dan Carpenter pointed out that error is uninitialized. While there
> never should be an attr leaf block with zero entries, let's not leave
> that logic bomb there.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Fixes: 0bb9d159bd01 ("xfs: streamline xfs_attr3_leaf_inactive")
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> ---
> fs/xfs/xfs_attr_inactive.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
> index eddd5d311b0c..bbfa6ba84dcd 100644
> --- a/fs/xfs/xfs_attr_inactive.c
> +++ b/fs/xfs/xfs_attr_inactive.c
> @@ -89,7 +89,7 @@ xfs_attr3_leaf_inactive(
> struct xfs_attr_leafblock *leaf = bp->b_addr;
> struct xfs_attr_leaf_entry *entry;
> struct xfs_attr_leaf_name_remote *name_rmt;
> - int error;
> + int error = 0;
> int i;
>
> xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-23 22:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-23 15:55 [PATCH] xfs: fix uninitialized variable in xfs_attr3_leaf_inactive Darrick J. Wong
2020-01-23 16:36 ` Allison Collins
2020-01-23 22:23 ` Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).