diff --git a/fs/hfs/bfind.c b/fs/hfs/bfind.c index ef9498a6e88acd39e81cbfc2d5d0406477da0a1c..ae44c8fa86ec82b935bd3afdbf5b572acf77cb9c 100644 --- a/fs/hfs/bfind.c +++ b/fs/hfs/bfind.c @@ -16,6 +16,8 @@ int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) { void *ptr; + if (!tree) + return -EINVAL; fd->tree = tree; fd->bnode = NULL; ptr = kmalloc(tree->max_key_len * 2 + 4, GFP_KERNEL);