diff mbox series

mm: compaction.c: Propagate return value upstream

Message ID 20181226190750.9820-1-pakki001@umn.edu (mailing list archive)
State New, archived
Headers show
Series mm: compaction.c: Propagate return value upstream | expand

Commit Message

Aditya Pakki Dec. 26, 2018, 7:07 p.m. UTC
In sysctl_extfrag_handler(), proc_dointvec_minmax() can return an
error. The fix propagates the error upstream in case of failure.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 mm/compaction.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Matthew Wilcox Dec. 26, 2018, 7:11 p.m. UTC | #1
On Wed, Dec 26, 2018 at 01:07:49PM -0600, Aditya Pakki wrote:
>  {
> +	return
>  	proc_dointvec_minmax(table, write, buffer, length, ppos);
> -
> -	return 0;

Don't do this.  If you're going to return something, it should be on the same
line as the return statement.

ie:

+	return proc_dointvec_minmax(table, write, buffer, length, ppos);
diff mbox series

Patch

diff --git a/mm/compaction.c b/mm/compaction.c
index 7c607479de4a..5703b4051796 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1879,9 +1879,8 @@  int sysctl_compaction_handler(struct ctl_table *table, int write,
 int sysctl_extfrag_handler(struct ctl_table *table, int write,
 			void __user *buffer, size_t *length, loff_t *ppos)
 {
+	return
 	proc_dointvec_minmax(table, write, buffer, length, ppos);
-
-	return 0;
 }
 
 #if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)