Skip to contentSkip to conversation

Fix: code-style warning

PATCH Kees Cook 1 participant 1 message Nov 13, 2017 1 message not in the archive VFS

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Kees Cook

author Acked-by
#1 lore raw
Quoted 3 lines · Ola N. Kaldestad

Removed unnecessary else block, and removed redundant return and call to kfree in if block.

Thanks for resending this. Andrew, can you take this clean-up, please?

-Kees

Quoted 28 lines
---
 kernel/sysctl.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
kernel/sysctl.c +2 -6
index d9c31bc2eaea..83b1685d3f15 100644
@@ -3089,14 +3089,11 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
                        else
                                bitmap_copy(bitmap, tmp_bitmap, bitmap_len);
                }
-               kfree(tmp_bitmap);
                *lenp -= left;
                *ppos += *lenp;
-               return 0;
-       } else {
-               kfree(tmp_bitmap);
-               return err;
        }
+       kfree(tmp_bitmap);
+       return err;
 }
 
 #else /* CONFIG_PROC_SYSCTL */
--

2.7.4

Signature · 2 lines
Kees Cook
Pixel Security