From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [brgl-linux:gpio/for-next 39/39] drivers/gpio/gpio-sim.c:755 gpio_sim_config_make_item() error: dereferencing freed memory 'config'
Date: Mon, 26 Apr 2021 22:31:11 +0800 [thread overview]
Message-ID: <202104262208.uKGDVMfQ-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2781 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Bartosz Golaszewski <bgolaszewski@baylibre.com>
CC: Andy Shevchenko <andy.shevchenko@gmail.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
head: a49d14276ac40782a4a06b7d9043df1cbca7c434
commit: a49d14276ac40782a4a06b7d9043df1cbca7c434 [39/39] gpio: sim: allocate IDA numbers earlier
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: arc-randconfig-m031-20210426 (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.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:
drivers/gpio/gpio-sim.c:755 gpio_sim_config_make_item() error: dereferencing freed memory 'config'
vim +/config +755 drivers/gpio/gpio-sim.c
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 742
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 743 static struct config_item *
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 744 gpio_sim_config_make_item(struct config_group *group, const char *name)
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 745 {
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 746 struct gpio_sim_chip_config *config;
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 747
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 748 config = kzalloc(sizeof(*config), GFP_KERNEL);
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 749 if (!config)
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 750 return ERR_PTR(-ENOMEM);
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 751
a49d14276ac407 Bartosz Golaszewski 2021-04-23 752 config->id = ida_alloc(&gpio_sim_ida, GFP_KERNEL);
a49d14276ac407 Bartosz Golaszewski 2021-04-23 753 if (config->id < 0) {
a49d14276ac407 Bartosz Golaszewski 2021-04-23 754 kfree(config);
a49d14276ac407 Bartosz Golaszewski 2021-04-23 @755 return ERR_PTR(config->id);
a49d14276ac407 Bartosz Golaszewski 2021-04-23 756 }
a49d14276ac407 Bartosz Golaszewski 2021-04-23 757
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 758 config_item_init_type_name(&config->item, name,
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 759 &gpio_sim_chip_config_type);
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 760 config->num_lines = 1;
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 761 mutex_init(&config->lock);
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 762
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 763 return &config->item;
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 764 }
3f0279eb9e3767 Bartosz Golaszewski 2021-03-15 765
---
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: 24599 bytes --]
reply other threads:[~2021-04-26 14:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202104262208.uKGDVMfQ-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.