Commit 14dd01f8 authored by Chuck Ebbert's avatar Chuck Ebbert Committed by Christoph Hellwig

hfsplus: do not leak buffer on error

Signed-Off-By: default avatarChuck Ebbert <cebbert@redhat.com>
Signed-off-by: default avatarChristoph Hellwig <hch@tuxera.com>
parent c5b8d0bc
...@@ -134,7 +134,7 @@ int hfs_part_find(struct super_block *sb, ...@@ -134,7 +134,7 @@ int hfs_part_find(struct super_block *sb,
res = hfsplus_submit_bio(sb->s_bdev, *part_start + HFS_PMAP_BLK, res = hfsplus_submit_bio(sb->s_bdev, *part_start + HFS_PMAP_BLK,
data, READ); data, READ);
if (res) if (res)
return res; goto out;
switch (be16_to_cpu(*((__be16 *)data))) { switch (be16_to_cpu(*((__be16 *)data))) {
case HFS_OLD_PMAP_MAGIC: case HFS_OLD_PMAP_MAGIC:
...@@ -147,7 +147,7 @@ int hfs_part_find(struct super_block *sb, ...@@ -147,7 +147,7 @@ int hfs_part_find(struct super_block *sb,
res = -ENOENT; res = -ENOENT;
break; break;
} }
out:
kfree(data); kfree(data);
return res; return res;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment