[kbuild] mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR'
BCC: l...@intel.com CC: kbuild-...@lists.01.org CC: linux-ker...@vger.kernel.org TO: SeongJae Park CC: Andrew Morton CC: Linux Memory Management List tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 15b3f48a4339e3c16acf18624e2b7f60bc5e9a2c commit: af122dd8f3c0099349bc98ff69f0d90efd8b149f mm/damon/dbgfs: support DAMON-based Operation Schemes date: 10 months ago :: branch date: 11 hours ago :: commit date: 10 months ago config: parisc-randconfig-m031-20220821 (https://download.01.org/0day-ci/archive/20220821/202208211602.0nj8xuw7-...@intel.com/config) compiler: hppa-linux-gcc (GCC) 12.1.0 If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR' vim +/PTR_ERR +227 mm/damon/dbgfs.c af122dd8f3c009 SeongJae Park 2021-11-05 215 af122dd8f3c009 SeongJae Park 2021-11-05 216 static ssize_t dbgfs_schemes_write(struct file *file, const char __user *buf, af122dd8f3c009 SeongJae Park 2021-11-05 217size_t count, loff_t *ppos) af122dd8f3c009 SeongJae Park 2021-11-05 218 { af122dd8f3c009 SeongJae Park 2021-11-05 219struct damon_ctx *ctx = file->private_data; af122dd8f3c009 SeongJae Park 2021-11-05 220char *kbuf; af122dd8f3c009 SeongJae Park 2021-11-05 221struct damos **schemes; af122dd8f3c009 SeongJae Park 2021-11-05 222ssize_t nr_schemes = 0, ret = count; af122dd8f3c009 SeongJae Park 2021-11-05 223int err; af122dd8f3c009 SeongJae Park 2021-11-05 224 af122dd8f3c009 SeongJae Park 2021-11-05 225kbuf = user_input_str(buf, count, ppos); af122dd8f3c009 SeongJae Park 2021-11-05 226if (IS_ERR(kbuf)) af122dd8f3c009 SeongJae Park 2021-11-05 @227return PTR_ERR(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 228 af122dd8f3c009 SeongJae Park 2021-11-05 229schemes = str_to_schemes(kbuf, ret, _schemes); af122dd8f3c009 SeongJae Park 2021-11-05 230if (!schemes) { af122dd8f3c009 SeongJae Park 2021-11-05 231ret = -EINVAL; af122dd8f3c009 SeongJae Park 2021-11-05 232goto out; af122dd8f3c009 SeongJae Park 2021-11-05 233} af122dd8f3c009 SeongJae Park 2021-11-05 234 af122dd8f3c009 SeongJae Park 2021-11-05 235mutex_lock(>kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 236if (ctx->kdamond) { af122dd8f3c009 SeongJae Park 2021-11-05 237ret = -EBUSY; af122dd8f3c009 SeongJae Park 2021-11-05 238goto unlock_out; af122dd8f3c009 SeongJae Park 2021-11-05 239} af122dd8f3c009 SeongJae Park 2021-11-05 240 af122dd8f3c009 SeongJae Park 2021-11-05 241err = damon_set_schemes(ctx, schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 242if (err) af122dd8f3c009 SeongJae Park 2021-11-05 243ret = err; af122dd8f3c009 SeongJae Park 2021-11-05 244else af122dd8f3c009 SeongJae Park 2021-11-05 245nr_schemes = 0; af122dd8f3c009 SeongJae Park 2021-11-05 246 unlock_out: af122dd8f3c009 SeongJae Park 2021-11-05 247 mutex_unlock(>kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 248free_schemes_arr(schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 249 out: af122dd8f3c009 SeongJae Park 2021-11-05 250kfree(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 251return ret; af122dd8f3c009 SeongJae Park 2021-11-05 252 } af122dd8f3c009 SeongJae Park 2021-11-05 253 -- 0-DAY CI Kernel Test Service https://01.org/lkp ___ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org
[kbuild] mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR'
CC: kbuild-...@lists.01.org BCC: l...@intel.com CC: linux-ker...@vger.kernel.org TO: SeongJae Park CC: Andrew Morton CC: Linux Memory Management List tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 787af64d05cd528aac9ad16752d11bb1c6061bb9 commit: af122dd8f3c0099349bc98ff69f0d90efd8b149f mm/damon/dbgfs: support DAMON-based Operation Schemes date: 5 months ago :: branch date: 13 hours ago :: commit date: 5 months ago config: arc-randconfig-m031-20220331 (https://download.01.org/0day-ci/archive/20220331/202203311938.cvfj0j5j-...@intel.com/config) compiler: arceb-elf-gcc (GCC) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR' vim +/PTR_ERR +227 mm/damon/dbgfs.c af122dd8f3c009 SeongJae Park 2021-11-05 215 af122dd8f3c009 SeongJae Park 2021-11-05 216 static ssize_t dbgfs_schemes_write(struct file *file, const char __user *buf, af122dd8f3c009 SeongJae Park 2021-11-05 217size_t count, loff_t *ppos) af122dd8f3c009 SeongJae Park 2021-11-05 218 { af122dd8f3c009 SeongJae Park 2021-11-05 219struct damon_ctx *ctx = file->private_data; af122dd8f3c009 SeongJae Park 2021-11-05 220char *kbuf; af122dd8f3c009 SeongJae Park 2021-11-05 221struct damos **schemes; af122dd8f3c009 SeongJae Park 2021-11-05 222ssize_t nr_schemes = 0, ret = count; af122dd8f3c009 SeongJae Park 2021-11-05 223int err; af122dd8f3c009 SeongJae Park 2021-11-05 224 af122dd8f3c009 SeongJae Park 2021-11-05 225kbuf = user_input_str(buf, count, ppos); af122dd8f3c009 SeongJae Park 2021-11-05 226if (IS_ERR(kbuf)) af122dd8f3c009 SeongJae Park 2021-11-05 @227return PTR_ERR(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 228 af122dd8f3c009 SeongJae Park 2021-11-05 229schemes = str_to_schemes(kbuf, ret, _schemes); af122dd8f3c009 SeongJae Park 2021-11-05 230if (!schemes) { af122dd8f3c009 SeongJae Park 2021-11-05 231ret = -EINVAL; af122dd8f3c009 SeongJae Park 2021-11-05 232goto out; af122dd8f3c009 SeongJae Park 2021-11-05 233} af122dd8f3c009 SeongJae Park 2021-11-05 234 af122dd8f3c009 SeongJae Park 2021-11-05 235mutex_lock(>kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 236if (ctx->kdamond) { af122dd8f3c009 SeongJae Park 2021-11-05 237ret = -EBUSY; af122dd8f3c009 SeongJae Park 2021-11-05 238goto unlock_out; af122dd8f3c009 SeongJae Park 2021-11-05 239} af122dd8f3c009 SeongJae Park 2021-11-05 240 af122dd8f3c009 SeongJae Park 2021-11-05 241err = damon_set_schemes(ctx, schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 242if (err) af122dd8f3c009 SeongJae Park 2021-11-05 243ret = err; af122dd8f3c009 SeongJae Park 2021-11-05 244else af122dd8f3c009 SeongJae Park 2021-11-05 245nr_schemes = 0; af122dd8f3c009 SeongJae Park 2021-11-05 246 unlock_out: af122dd8f3c009 SeongJae Park 2021-11-05 247 mutex_unlock(>kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 248free_schemes_arr(schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 249 out: af122dd8f3c009 SeongJae Park 2021-11-05 250kfree(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 251return ret; af122dd8f3c009 SeongJae Park 2021-11-05 252 } af122dd8f3c009 SeongJae Park 2021-11-05 253 -- 0-DAY CI Kernel Test Service https://01.org/lkp ___ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org
[kbuild] mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR'
CC: kbuild-...@lists.01.org BCC: l...@intel.com CC: linux-ker...@vger.kernel.org TO: SeongJae Park CC: Andrew Morton CC: Linux Memory Management List tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 1db333d9a51f3459fba1bcaa564d95befe79f0b3 commit: af122dd8f3c0099349bc98ff69f0d90efd8b149f mm/damon/dbgfs: support DAMON-based Operation Schemes date: 4 months ago :: branch date: 8 hours ago :: commit date: 4 months ago config: arc-randconfig-m031-20220310 (https://download.01.org/0day-ci/archive/20220311/202203110455.vybmk8pt-...@intel.com/config) compiler: arceb-elf-gcc (GCC) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR' vim +/PTR_ERR +227 mm/damon/dbgfs.c af122dd8f3c009 SeongJae Park 2021-11-05 215 af122dd8f3c009 SeongJae Park 2021-11-05 216 static ssize_t dbgfs_schemes_write(struct file *file, const char __user *buf, af122dd8f3c009 SeongJae Park 2021-11-05 217size_t count, loff_t *ppos) af122dd8f3c009 SeongJae Park 2021-11-05 218 { af122dd8f3c009 SeongJae Park 2021-11-05 219struct damon_ctx *ctx = file->private_data; af122dd8f3c009 SeongJae Park 2021-11-05 220char *kbuf; af122dd8f3c009 SeongJae Park 2021-11-05 221struct damos **schemes; af122dd8f3c009 SeongJae Park 2021-11-05 222ssize_t nr_schemes = 0, ret = count; af122dd8f3c009 SeongJae Park 2021-11-05 223int err; af122dd8f3c009 SeongJae Park 2021-11-05 224 af122dd8f3c009 SeongJae Park 2021-11-05 225kbuf = user_input_str(buf, count, ppos); af122dd8f3c009 SeongJae Park 2021-11-05 226if (IS_ERR(kbuf)) af122dd8f3c009 SeongJae Park 2021-11-05 @227return PTR_ERR(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 228 af122dd8f3c009 SeongJae Park 2021-11-05 229schemes = str_to_schemes(kbuf, ret, _schemes); af122dd8f3c009 SeongJae Park 2021-11-05 230if (!schemes) { af122dd8f3c009 SeongJae Park 2021-11-05 231ret = -EINVAL; af122dd8f3c009 SeongJae Park 2021-11-05 232goto out; af122dd8f3c009 SeongJae Park 2021-11-05 233} af122dd8f3c009 SeongJae Park 2021-11-05 234 af122dd8f3c009 SeongJae Park 2021-11-05 235mutex_lock(>kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 236if (ctx->kdamond) { af122dd8f3c009 SeongJae Park 2021-11-05 237ret = -EBUSY; af122dd8f3c009 SeongJae Park 2021-11-05 238goto unlock_out; af122dd8f3c009 SeongJae Park 2021-11-05 239} af122dd8f3c009 SeongJae Park 2021-11-05 240 af122dd8f3c009 SeongJae Park 2021-11-05 241err = damon_set_schemes(ctx, schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 242if (err) af122dd8f3c009 SeongJae Park 2021-11-05 243ret = err; af122dd8f3c009 SeongJae Park 2021-11-05 244else af122dd8f3c009 SeongJae Park 2021-11-05 245nr_schemes = 0; af122dd8f3c009 SeongJae Park 2021-11-05 246 unlock_out: af122dd8f3c009 SeongJae Park 2021-11-05 247 mutex_unlock(>kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 248free_schemes_arr(schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 249 out: af122dd8f3c009 SeongJae Park 2021-11-05 250kfree(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 251return ret; af122dd8f3c009 SeongJae Park 2021-11-05 252 } af122dd8f3c009 SeongJae Park 2021-11-05 253 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org ___ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org
[kbuild] mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR'
CC: kbuild-...@lists.01.org CC: linux-ker...@vger.kernel.org TO: SeongJae Park CC: Andrew Morton CC: Linux Memory Management List tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 79a72162048e42a677bc7336a9f5d86fc3ff9558 commit: af122dd8f3c0099349bc98ff69f0d90efd8b149f mm/damon/dbgfs: support DAMON-based Operation Schemes date: 4 weeks ago :: branch date: 3 hours ago :: commit date: 4 weeks ago config: nios2-randconfig-m031-20211202 (https://download.01.org/0day-ci/archive/20211205/202112051142.duifl7h9-...@intel.com/config) compiler: nios2-linux-gcc (GCC) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR' vim +/PTR_ERR +227 mm/damon/dbgfs.c af122dd8f3c009 SeongJae Park 2021-11-05 215 af122dd8f3c009 SeongJae Park 2021-11-05 216 static ssize_t dbgfs_schemes_write(struct file *file, const char __user *buf, af122dd8f3c009 SeongJae Park 2021-11-05 217size_t count, loff_t *ppos) af122dd8f3c009 SeongJae Park 2021-11-05 218 { af122dd8f3c009 SeongJae Park 2021-11-05 219struct damon_ctx *ctx = file->private_data; af122dd8f3c009 SeongJae Park 2021-11-05 220char *kbuf; af122dd8f3c009 SeongJae Park 2021-11-05 221struct damos **schemes; af122dd8f3c009 SeongJae Park 2021-11-05 222ssize_t nr_schemes = 0, ret = count; af122dd8f3c009 SeongJae Park 2021-11-05 223int err; af122dd8f3c009 SeongJae Park 2021-11-05 224 af122dd8f3c009 SeongJae Park 2021-11-05 225kbuf = user_input_str(buf, count, ppos); af122dd8f3c009 SeongJae Park 2021-11-05 226if (IS_ERR(kbuf)) af122dd8f3c009 SeongJae Park 2021-11-05 @227return PTR_ERR(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 228 af122dd8f3c009 SeongJae Park 2021-11-05 229schemes = str_to_schemes(kbuf, ret, _schemes); af122dd8f3c009 SeongJae Park 2021-11-05 230if (!schemes) { af122dd8f3c009 SeongJae Park 2021-11-05 231ret = -EINVAL; af122dd8f3c009 SeongJae Park 2021-11-05 232goto out; af122dd8f3c009 SeongJae Park 2021-11-05 233} af122dd8f3c009 SeongJae Park 2021-11-05 234 af122dd8f3c009 SeongJae Park 2021-11-05 235mutex_lock(>kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 236if (ctx->kdamond) { af122dd8f3c009 SeongJae Park 2021-11-05 237ret = -EBUSY; af122dd8f3c009 SeongJae Park 2021-11-05 238goto unlock_out; af122dd8f3c009 SeongJae Park 2021-11-05 239} af122dd8f3c009 SeongJae Park 2021-11-05 240 af122dd8f3c009 SeongJae Park 2021-11-05 241err = damon_set_schemes(ctx, schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 242if (err) af122dd8f3c009 SeongJae Park 2021-11-05 243ret = err; af122dd8f3c009 SeongJae Park 2021-11-05 244else af122dd8f3c009 SeongJae Park 2021-11-05 245nr_schemes = 0; af122dd8f3c009 SeongJae Park 2021-11-05 246 unlock_out: af122dd8f3c009 SeongJae Park 2021-11-05 247 mutex_unlock(>kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 248free_schemes_arr(schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 249 out: af122dd8f3c009 SeongJae Park 2021-11-05 250kfree(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 251return ret; af122dd8f3c009 SeongJae Park 2021-11-05 252 } af122dd8f3c009 SeongJae Park 2021-11-05 253 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org ___ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org
[kbuild] mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR'
CC: kbuild-...@lists.01.org CC: linux-ker...@vger.kernel.org TO: SeongJae Park CC: Andrew Morton CC: Linux Memory Management List tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 5d9f4cf36721aba199975a9be7863a3ff5cd4b59 commit: af122dd8f3c0099349bc98ff69f0d90efd8b149f mm/damon/dbgfs: support DAMON-based Operation Schemes date: 3 weeks ago :: branch date: 15 hours ago :: commit date: 3 weeks ago config: nios2-randconfig-m031-20211123 (https://download.01.org/0day-ci/archive/20211124/202111242159.c8ouotfg-...@intel.com/config) compiler: nios2-linux-gcc (GCC) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR' vim +/PTR_ERR +227 mm/damon/dbgfs.c af122dd8f3c009 SeongJae Park 2021-11-05 215 af122dd8f3c009 SeongJae Park 2021-11-05 216 static ssize_t dbgfs_schemes_write(struct file *file, const char __user *buf, af122dd8f3c009 SeongJae Park 2021-11-05 217size_t count, loff_t *ppos) af122dd8f3c009 SeongJae Park 2021-11-05 218 { af122dd8f3c009 SeongJae Park 2021-11-05 219struct damon_ctx *ctx = file->private_data; af122dd8f3c009 SeongJae Park 2021-11-05 220char *kbuf; af122dd8f3c009 SeongJae Park 2021-11-05 221struct damos **schemes; af122dd8f3c009 SeongJae Park 2021-11-05 222ssize_t nr_schemes = 0, ret = count; af122dd8f3c009 SeongJae Park 2021-11-05 223int err; af122dd8f3c009 SeongJae Park 2021-11-05 224 af122dd8f3c009 SeongJae Park 2021-11-05 225kbuf = user_input_str(buf, count, ppos); af122dd8f3c009 SeongJae Park 2021-11-05 226if (IS_ERR(kbuf)) af122dd8f3c009 SeongJae Park 2021-11-05 @227return PTR_ERR(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 228 af122dd8f3c009 SeongJae Park 2021-11-05 229schemes = str_to_schemes(kbuf, ret, _schemes); af122dd8f3c009 SeongJae Park 2021-11-05 230if (!schemes) { af122dd8f3c009 SeongJae Park 2021-11-05 231ret = -EINVAL; af122dd8f3c009 SeongJae Park 2021-11-05 232goto out; af122dd8f3c009 SeongJae Park 2021-11-05 233} af122dd8f3c009 SeongJae Park 2021-11-05 234 af122dd8f3c009 SeongJae Park 2021-11-05 235mutex_lock(>kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 236if (ctx->kdamond) { af122dd8f3c009 SeongJae Park 2021-11-05 237ret = -EBUSY; af122dd8f3c009 SeongJae Park 2021-11-05 238goto unlock_out; af122dd8f3c009 SeongJae Park 2021-11-05 239} af122dd8f3c009 SeongJae Park 2021-11-05 240 af122dd8f3c009 SeongJae Park 2021-11-05 241err = damon_set_schemes(ctx, schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 242if (err) af122dd8f3c009 SeongJae Park 2021-11-05 243ret = err; af122dd8f3c009 SeongJae Park 2021-11-05 244else af122dd8f3c009 SeongJae Park 2021-11-05 245nr_schemes = 0; af122dd8f3c009 SeongJae Park 2021-11-05 246 unlock_out: af122dd8f3c009 SeongJae Park 2021-11-05 247 mutex_unlock(>kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 248free_schemes_arr(schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 249 out: af122dd8f3c009 SeongJae Park 2021-11-05 250kfree(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 251return ret; af122dd8f3c009 SeongJae Park 2021-11-05 252 } af122dd8f3c009 SeongJae Park 2021-11-05 253 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org ___ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org