All of lore.kernel.org
 help / color / mirror / Atom feed
* [hnaz-mm:master 280/435] mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR'
@ 2021-11-06  6:07 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-11-06  6:07 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3650 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: SeongJae Park <sj@kernel.org>
CC: Johannes Weiner <hannes@cmpxchg.org>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>

tree:   https://github.com/hnaz/linux-mm master
head:   b8280145cf2a894c873fdf91fb2af474c52ac6cc
commit: 82bb324ecd8be8ea94ab8d578b326f7de65c122c [280/435] mm/damon/dbgfs: support DAMON-based Operation Schemes
:::::: branch date: 9 days ago
:::::: commit date: 9 days ago
config: microblaze-randconfig-m031-20211104 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@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

82bb324ecd8be8 SeongJae Park 2021-10-28  215  
82bb324ecd8be8 SeongJae Park 2021-10-28  216  static ssize_t dbgfs_schemes_write(struct file *file, const char __user *buf,
82bb324ecd8be8 SeongJae Park 2021-10-28  217  		size_t count, loff_t *ppos)
82bb324ecd8be8 SeongJae Park 2021-10-28  218  {
82bb324ecd8be8 SeongJae Park 2021-10-28  219  	struct damon_ctx *ctx = file->private_data;
82bb324ecd8be8 SeongJae Park 2021-10-28  220  	char *kbuf;
82bb324ecd8be8 SeongJae Park 2021-10-28  221  	struct damos **schemes;
82bb324ecd8be8 SeongJae Park 2021-10-28  222  	ssize_t nr_schemes = 0, ret = count;
82bb324ecd8be8 SeongJae Park 2021-10-28  223  	int err;
82bb324ecd8be8 SeongJae Park 2021-10-28  224  
82bb324ecd8be8 SeongJae Park 2021-10-28  225  	kbuf = user_input_str(buf, count, ppos);
82bb324ecd8be8 SeongJae Park 2021-10-28  226  	if (IS_ERR(kbuf))
82bb324ecd8be8 SeongJae Park 2021-10-28 @227  		return PTR_ERR(kbuf);
82bb324ecd8be8 SeongJae Park 2021-10-28  228  
82bb324ecd8be8 SeongJae Park 2021-10-28  229  	schemes = str_to_schemes(kbuf, ret, &nr_schemes);
82bb324ecd8be8 SeongJae Park 2021-10-28  230  	if (!schemes) {
82bb324ecd8be8 SeongJae Park 2021-10-28  231  		ret = -EINVAL;
82bb324ecd8be8 SeongJae Park 2021-10-28  232  		goto out;
82bb324ecd8be8 SeongJae Park 2021-10-28  233  	}
82bb324ecd8be8 SeongJae Park 2021-10-28  234  
82bb324ecd8be8 SeongJae Park 2021-10-28  235  	mutex_lock(&ctx->kdamond_lock);
82bb324ecd8be8 SeongJae Park 2021-10-28  236  	if (ctx->kdamond) {
82bb324ecd8be8 SeongJae Park 2021-10-28  237  		ret = -EBUSY;
82bb324ecd8be8 SeongJae Park 2021-10-28  238  		goto unlock_out;
82bb324ecd8be8 SeongJae Park 2021-10-28  239  	}
82bb324ecd8be8 SeongJae Park 2021-10-28  240  
82bb324ecd8be8 SeongJae Park 2021-10-28  241  	err = damon_set_schemes(ctx, schemes, nr_schemes);
82bb324ecd8be8 SeongJae Park 2021-10-28  242  	if (err)
82bb324ecd8be8 SeongJae Park 2021-10-28  243  		ret = err;
82bb324ecd8be8 SeongJae Park 2021-10-28  244  	else
82bb324ecd8be8 SeongJae Park 2021-10-28  245  		nr_schemes = 0;
82bb324ecd8be8 SeongJae Park 2021-10-28  246  unlock_out:
82bb324ecd8be8 SeongJae Park 2021-10-28  247  	mutex_unlock(&ctx->kdamond_lock);
82bb324ecd8be8 SeongJae Park 2021-10-28  248  	free_schemes_arr(schemes, nr_schemes);
82bb324ecd8be8 SeongJae Park 2021-10-28  249  out:
82bb324ecd8be8 SeongJae Park 2021-10-28  250  	kfree(kbuf);
82bb324ecd8be8 SeongJae Park 2021-10-28  251  	return ret;
82bb324ecd8be8 SeongJae Park 2021-10-28  252  }
82bb324ecd8be8 SeongJae Park 2021-10-28  253  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34682 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [hnaz-mm:master 280/435] mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR'
@ 2021-11-11 21:35 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-11-11 21:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3652 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: SeongJae Park <sj@kernel.org>
CC: Johannes Weiner <hannes@cmpxchg.org>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>

tree:   https://github.com/hnaz/linux-mm master
head:   b8280145cf2a894c873fdf91fb2af474c52ac6cc
commit: 82bb324ecd8be8ea94ab8d578b326f7de65c122c [280/435] mm/damon/dbgfs: support DAMON-based Operation Schemes
:::::: branch date: 2 weeks ago
:::::: commit date: 2 weeks ago
config: microblaze-randconfig-m031-20211104 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@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

82bb324ecd8be8 SeongJae Park 2021-10-28  215  
82bb324ecd8be8 SeongJae Park 2021-10-28  216  static ssize_t dbgfs_schemes_write(struct file *file, const char __user *buf,
82bb324ecd8be8 SeongJae Park 2021-10-28  217  		size_t count, loff_t *ppos)
82bb324ecd8be8 SeongJae Park 2021-10-28  218  {
82bb324ecd8be8 SeongJae Park 2021-10-28  219  	struct damon_ctx *ctx = file->private_data;
82bb324ecd8be8 SeongJae Park 2021-10-28  220  	char *kbuf;
82bb324ecd8be8 SeongJae Park 2021-10-28  221  	struct damos **schemes;
82bb324ecd8be8 SeongJae Park 2021-10-28  222  	ssize_t nr_schemes = 0, ret = count;
82bb324ecd8be8 SeongJae Park 2021-10-28  223  	int err;
82bb324ecd8be8 SeongJae Park 2021-10-28  224  
82bb324ecd8be8 SeongJae Park 2021-10-28  225  	kbuf = user_input_str(buf, count, ppos);
82bb324ecd8be8 SeongJae Park 2021-10-28  226  	if (IS_ERR(kbuf))
82bb324ecd8be8 SeongJae Park 2021-10-28 @227  		return PTR_ERR(kbuf);
82bb324ecd8be8 SeongJae Park 2021-10-28  228  
82bb324ecd8be8 SeongJae Park 2021-10-28  229  	schemes = str_to_schemes(kbuf, ret, &nr_schemes);
82bb324ecd8be8 SeongJae Park 2021-10-28  230  	if (!schemes) {
82bb324ecd8be8 SeongJae Park 2021-10-28  231  		ret = -EINVAL;
82bb324ecd8be8 SeongJae Park 2021-10-28  232  		goto out;
82bb324ecd8be8 SeongJae Park 2021-10-28  233  	}
82bb324ecd8be8 SeongJae Park 2021-10-28  234  
82bb324ecd8be8 SeongJae Park 2021-10-28  235  	mutex_lock(&ctx->kdamond_lock);
82bb324ecd8be8 SeongJae Park 2021-10-28  236  	if (ctx->kdamond) {
82bb324ecd8be8 SeongJae Park 2021-10-28  237  		ret = -EBUSY;
82bb324ecd8be8 SeongJae Park 2021-10-28  238  		goto unlock_out;
82bb324ecd8be8 SeongJae Park 2021-10-28  239  	}
82bb324ecd8be8 SeongJae Park 2021-10-28  240  
82bb324ecd8be8 SeongJae Park 2021-10-28  241  	err = damon_set_schemes(ctx, schemes, nr_schemes);
82bb324ecd8be8 SeongJae Park 2021-10-28  242  	if (err)
82bb324ecd8be8 SeongJae Park 2021-10-28  243  		ret = err;
82bb324ecd8be8 SeongJae Park 2021-10-28  244  	else
82bb324ecd8be8 SeongJae Park 2021-10-28  245  		nr_schemes = 0;
82bb324ecd8be8 SeongJae Park 2021-10-28  246  unlock_out:
82bb324ecd8be8 SeongJae Park 2021-10-28  247  	mutex_unlock(&ctx->kdamond_lock);
82bb324ecd8be8 SeongJae Park 2021-10-28  248  	free_schemes_arr(schemes, nr_schemes);
82bb324ecd8be8 SeongJae Park 2021-10-28  249  out:
82bb324ecd8be8 SeongJae Park 2021-10-28  250  	kfree(kbuf);
82bb324ecd8be8 SeongJae Park 2021-10-28  251  	return ret;
82bb324ecd8be8 SeongJae Park 2021-10-28  252  }
82bb324ecd8be8 SeongJae Park 2021-10-28  253  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34682 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-11 21:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06  6:07 [hnaz-mm:master 280/435] mm/damon/dbgfs.c:227 dbgfs_schemes_write() warn: passing a valid pointer to 'PTR_ERR' kernel test robot
2021-11-11 21:35 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.