CC: kbuild-...@lists.01.org BCC: l...@intel.com CC: linux-ker...@vger.kernel.org TO: SeongJae Park <s...@kernel.org> CC: Andrew Morton <a...@linux-foundation.org> CC: Linux Memory Management List <linux...@kvack.org>
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 <l...@intel.com> Reported-by: Dan Carpenter <dan.carpen...@oracle.com> 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 217 size_t count, loff_t *ppos) af122dd8f3c009 SeongJae Park 2021-11-05 218 { af122dd8f3c009 SeongJae Park 2021-11-05 219 struct damon_ctx *ctx = file->private_data; af122dd8f3c009 SeongJae Park 2021-11-05 220 char *kbuf; af122dd8f3c009 SeongJae Park 2021-11-05 221 struct damos **schemes; af122dd8f3c009 SeongJae Park 2021-11-05 222 ssize_t nr_schemes = 0, ret = count; af122dd8f3c009 SeongJae Park 2021-11-05 223 int err; af122dd8f3c009 SeongJae Park 2021-11-05 224 af122dd8f3c009 SeongJae Park 2021-11-05 225 kbuf = user_input_str(buf, count, ppos); af122dd8f3c009 SeongJae Park 2021-11-05 226 if (IS_ERR(kbuf)) af122dd8f3c009 SeongJae Park 2021-11-05 @227 return PTR_ERR(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 228 af122dd8f3c009 SeongJae Park 2021-11-05 229 schemes = str_to_schemes(kbuf, ret, &nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 230 if (!schemes) { af122dd8f3c009 SeongJae Park 2021-11-05 231 ret = -EINVAL; af122dd8f3c009 SeongJae Park 2021-11-05 232 goto out; af122dd8f3c009 SeongJae Park 2021-11-05 233 } af122dd8f3c009 SeongJae Park 2021-11-05 234 af122dd8f3c009 SeongJae Park 2021-11-05 235 mutex_lock(&ctx->kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 236 if (ctx->kdamond) { af122dd8f3c009 SeongJae Park 2021-11-05 237 ret = -EBUSY; af122dd8f3c009 SeongJae Park 2021-11-05 238 goto unlock_out; af122dd8f3c009 SeongJae Park 2021-11-05 239 } af122dd8f3c009 SeongJae Park 2021-11-05 240 af122dd8f3c009 SeongJae Park 2021-11-05 241 err = damon_set_schemes(ctx, schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 242 if (err) af122dd8f3c009 SeongJae Park 2021-11-05 243 ret = err; af122dd8f3c009 SeongJae Park 2021-11-05 244 else af122dd8f3c009 SeongJae Park 2021-11-05 245 nr_schemes = 0; af122dd8f3c009 SeongJae Park 2021-11-05 246 unlock_out: af122dd8f3c009 SeongJae Park 2021-11-05 247 mutex_unlock(&ctx->kdamond_lock); af122dd8f3c009 SeongJae Park 2021-11-05 248 free_schemes_arr(schemes, nr_schemes); af122dd8f3c009 SeongJae Park 2021-11-05 249 out: af122dd8f3c009 SeongJae Park 2021-11-05 250 kfree(kbuf); af122dd8f3c009 SeongJae Park 2021-11-05 251 return 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