From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: mm/damon/dbgfs.c:525 dbgfs_init_regions_write() warn: passing a valid pointer to 'PTR_ERR'
Date: Fri, 11 Mar 2022 05:30:48 +0800 [thread overview]
Message-ID: <202203110552.cDoKPG8H-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3130 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: SeongJae Park <sj@kernel.org>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1db333d9a51f3459fba1bcaa564d95befe79f0b3
commit: 90bebce9fcd6488ba6b010af3a16a0a0d7e44cb6 mm/damon/dbgfs: allow users to set initial monitoring target regions
date: 4 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 4 months ago
config: arc-randconfig-m031-20220310 (https://download.01.org/0day-ci/archive/20220311/202203110552.cDoKPG8H-lkp(a)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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
mm/damon/dbgfs.c:525 dbgfs_init_regions_write() warn: passing a valid pointer to 'PTR_ERR'
vim +/PTR_ERR +525 mm/damon/dbgfs.c
90bebce9fcd648 SeongJae Park 2021-11-05 513
90bebce9fcd648 SeongJae Park 2021-11-05 514 static ssize_t dbgfs_init_regions_write(struct file *file,
90bebce9fcd648 SeongJae Park 2021-11-05 515 const char __user *buf, size_t count,
90bebce9fcd648 SeongJae Park 2021-11-05 516 loff_t *ppos)
90bebce9fcd648 SeongJae Park 2021-11-05 517 {
90bebce9fcd648 SeongJae Park 2021-11-05 518 struct damon_ctx *ctx = file->private_data;
90bebce9fcd648 SeongJae Park 2021-11-05 519 char *kbuf;
90bebce9fcd648 SeongJae Park 2021-11-05 520 ssize_t ret = count;
90bebce9fcd648 SeongJae Park 2021-11-05 521 int err;
90bebce9fcd648 SeongJae Park 2021-11-05 522
90bebce9fcd648 SeongJae Park 2021-11-05 523 kbuf = user_input_str(buf, count, ppos);
90bebce9fcd648 SeongJae Park 2021-11-05 524 if (IS_ERR(kbuf))
90bebce9fcd648 SeongJae Park 2021-11-05 @525 return PTR_ERR(kbuf);
90bebce9fcd648 SeongJae Park 2021-11-05 526
90bebce9fcd648 SeongJae Park 2021-11-05 527 mutex_lock(&ctx->kdamond_lock);
90bebce9fcd648 SeongJae Park 2021-11-05 528 if (ctx->kdamond) {
90bebce9fcd648 SeongJae Park 2021-11-05 529 ret = -EBUSY;
90bebce9fcd648 SeongJae Park 2021-11-05 530 goto unlock_out;
90bebce9fcd648 SeongJae Park 2021-11-05 531 }
90bebce9fcd648 SeongJae Park 2021-11-05 532
90bebce9fcd648 SeongJae Park 2021-11-05 533 err = set_init_regions(ctx, kbuf, ret);
90bebce9fcd648 SeongJae Park 2021-11-05 534 if (err)
90bebce9fcd648 SeongJae Park 2021-11-05 535 ret = err;
90bebce9fcd648 SeongJae Park 2021-11-05 536
90bebce9fcd648 SeongJae Park 2021-11-05 537 unlock_out:
90bebce9fcd648 SeongJae Park 2021-11-05 538 mutex_unlock(&ctx->kdamond_lock);
90bebce9fcd648 SeongJae Park 2021-11-05 539 kfree(kbuf);
90bebce9fcd648 SeongJae Park 2021-11-05 540 return ret;
90bebce9fcd648 SeongJae Park 2021-11-05 541 }
90bebce9fcd648 SeongJae Park 2021-11-05 542
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2022-03-10 21:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 21:30 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-10-02 21:07 mm/damon/dbgfs.c:525 dbgfs_init_regions_write() warn: passing a valid pointer to 'PTR_ERR' kernel test robot
2022-08-21 12:09 kernel test robot
2022-03-31 13:30 kernel test robot
2021-12-05 5:17 kernel test robot
2021-11-24 15:12 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202203110552.cDoKPG8H-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.