aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/gfs2/rgrp.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 43d1a20bdbe4..b6bbf718d6c3 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -1270,11 +1270,7 @@ int gfs2_fitrim(struct file *filp, void __user *argp)
1270 if (!blk_queue_discard(q)) 1270 if (!blk_queue_discard(q))
1271 return -EOPNOTSUPP; 1271 return -EOPNOTSUPP;
1272 1272
1273 if (argp == NULL) { 1273 if (copy_from_user(&r, argp, sizeof(r)))
1274 r.start = 0;
1275 r.len = ULLONG_MAX;
1276 r.minlen = 0;
1277 } else if (copy_from_user(&r, argp, sizeof(r)))
1278 return -EFAULT; 1274 return -EFAULT;
1279 1275
1280 ret = gfs2_rindex_update(sdp); 1276 ret = gfs2_rindex_update(sdp);
@@ -1323,7 +1319,7 @@ int gfs2_fitrim(struct file *filp, void __user *argp)
1323 1319
1324out: 1320out:
1325 r.len = trimmed << 9; 1321 r.len = trimmed << 9;
1326 if (argp && copy_to_user(argp, &r, sizeof(r))) 1322 if (copy_to_user(argp, &r, sizeof(r)))
1327 return -EFAULT; 1323 return -EFAULT;
1328 1324
1329 return ret; 1325 return ret;