From: Chuhong Yuan <hslester96@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Chuhong Yuan <hslester96@gmail.com>
Subject: [PATCH 2/2] hfsplus: add a check for hfs_bnode_find
Date: Wed, 16 Oct 2019 20:06:20 +0800 [thread overview]
Message-ID: <20191016120621.304-1-hslester96@gmail.com> (raw)
hfs_brec_update_parent misses a check for hfs_bnode_find and may miss
the failure.
Add a check for it like what is done in again.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
fs/hfsplus/brec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c
index 1918544a7871..22bada8288c4 100644
--- a/fs/hfsplus/brec.c
+++ b/fs/hfsplus/brec.c
@@ -434,6 +434,8 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd)
new_node->parent = tree->root;
}
fd->bnode = hfs_bnode_find(tree, new_node->parent);
+ if (IS_ERR(fd->bnode))
+ return PTR_ERR(fd->bnode);
/* create index key and entry */
hfs_bnode_read_key(new_node, fd->search_key, 14);
cnid = cpu_to_be32(new_node->this);
--
2.20.1
next reply other threads:[~2019-10-16 12:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-16 12:06 Chuhong Yuan [this message]
2019-10-17 0:07 ` [PATCH 2/2] hfsplus: add a check for hfs_bnode_find Ernesto A. Fernández
2019-10-17 1:30 ` Chuhong Yuan
2019-10-17 20:52 ` Ernesto A. Fernández
2019-10-18 8:52 ` Viacheslav Dubeyko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191016120621.304-1-hslester96@gmail.com \
--to=hslester96@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.