fs/ntfs3: Fix NULL pointer dereference on error in attr_allocate_frame()
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 26 Sep 2023 08:28:11 +0000 (11:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2023 13:10:59 +0000 (14:10 +0100)
[ Upstream commit 9c689c8dc86f8ca99bf91c05f24c8bab38fe7d5f ]

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ntfs3/attrib.c

index 6316952..2215179 100644 (file)
@@ -1658,10 +1658,8 @@ repack:
                        le_b = NULL;
                        attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA, NULL,
                                              0, NULL, &mi_b);
-                       if (!attr_b) {
-                               err = -ENOENT;
-                               goto out;
-                       }
+                       if (!attr_b)
+                               return -ENOENT;
 
                        attr = attr_b;
                        le = le_b;