All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	robh+dt@kernel.org, gregkh@linuxfoundation.org
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	devicetree@vger.kernel.org, ekangupt@qti.qualcomm.com,
	bkumar@qti.qualcomm.com, linux-kernel@vger.kernel.org,
	srini@kernel.org, bjorn.andersson@linaro.org,
	linux-arm-msm@vger.kernel.org,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: Re: [PATCH v3 01/12] misc: fastrpc: separate fastrpc device from channel context
Date: Thu, 27 Jan 2022 14:33:50 +0300	[thread overview]
Message-ID: <202201271857.MGiOkhFo-lkp@intel.com> (raw)
In-Reply-To: <20220126135304.16340-2-srinivas.kandagatla@linaro.org>

Hi Srinivas,

url:    https://github.com/0day-ci/linux/commits/Srinivas-Kandagatla/misc-fastrpc-Add-missing-DSP-FastRPC-features/20220126-215705
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 515a2f507491e7c3818e74ef4f4e088c1fecb190
config: openrisc-randconfig-m031-20220124 (https://download.01.org/0day-ci/archive/20220127/202201271857.MGiOkhFo-lkp@intel.com/config)
compiler: or1k-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>

New smatch warnings:
drivers/misc/fastrpc.c:1636 fastrpc_device_register() warn: passing devm_ allocated variable to kfree. 'fdev'

vim +/fdev +1636 drivers/misc/fastrpc.c

99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1620  static int fastrpc_device_register(struct device *dev, struct fastrpc_channel_ctx *cctx,
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1621  				   const char *domain)
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1622  {
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1623  	struct fastrpc_device *fdev;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1624  	int err;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1625  
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1626  	fdev = devm_kzalloc(dev, sizeof(*fdev), GFP_KERNEL);
                                                        ^^^^^^^^^^^^^^^^^^^

99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1627  	if (!fdev)
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1628  		return -ENOMEM;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1629  
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1630  	fdev->cctx = cctx;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1631  	fdev->miscdev.minor = MISC_DYNAMIC_MINOR;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1632  	fdev->miscdev.fops = &fastrpc_fops;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1633  	fdev->miscdev.name = devm_kasprintf(dev, GFP_KERNEL, "fastrpc-%s", domain);
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1634  	err = misc_register(&fdev->miscdev);
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1635  	if (err)
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26 @1636  		kfree(fdev);
                                                                ^^^^^^^^^^^
Double free

99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1637  	else
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1638  		cctx->fdevice = fdev;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1639  
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1640  	return err;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1641  }

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


WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH v3 01/12] misc: fastrpc: separate fastrpc device from channel context
Date: Thu, 27 Jan 2022 18:15:24 +0800	[thread overview]
Message-ID: <202201271857.MGiOkhFo-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20220126135304.16340-2-srinivas.kandagatla@linaro.org>
References: <20220126135304.16340-2-srinivas.kandagatla@linaro.org>
TO: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
TO: robh+dt(a)kernel.org
TO: gregkh(a)linuxfoundation.org
CC: devicetree(a)vger.kernel.org
CC: ekangupt(a)qti.qualcomm.com
CC: bkumar(a)qti.qualcomm.com
CC: linux-kernel(a)vger.kernel.org
CC: srini(a)kernel.org
CC: bjorn.andersson(a)linaro.org
CC: linux-arm-msm(a)vger.kernel.org
CC: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

Hi Srinivas,

I love your patch! Perhaps something to improve:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on robh/for-next linux/master linus/master v5.17-rc1 next-20220127]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Srinivas-Kandagatla/misc-fastrpc-Add-missing-DSP-FastRPC-features/20220126-215705
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 515a2f507491e7c3818e74ef4f4e088c1fecb190
:::::: branch date: 20 hours ago
:::::: commit date: 20 hours ago
config: openrisc-randconfig-m031-20220124 (https://download.01.org/0day-ci/archive/20220127/202201271857.MGiOkhFo-lkp(a)intel.com/config)
compiler: or1k-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>

New smatch warnings:
drivers/misc/fastrpc.c:1636 fastrpc_device_register() warn: passing devm_ allocated variable to kfree. 'fdev'

Old smatch warnings:
drivers/misc/fastrpc.c:504 fastrpc_context_alloc() warn: should 'ret << 4' be a 64 bit type?

vim +/fdev +1636 drivers/misc/fastrpc.c

f6f9279f2bf0e37 Srinivas Kandagatla 2019-02-08  1619  
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1620  static int fastrpc_device_register(struct device *dev, struct fastrpc_channel_ctx *cctx,
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1621  				   const char *domain)
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1622  {
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1623  	struct fastrpc_device *fdev;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1624  	int err;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1625  
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1626  	fdev = devm_kzalloc(dev, sizeof(*fdev), GFP_KERNEL);
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1627  	if (!fdev)
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1628  		return -ENOMEM;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1629  
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1630  	fdev->cctx = cctx;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1631  	fdev->miscdev.minor = MISC_DYNAMIC_MINOR;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1632  	fdev->miscdev.fops = &fastrpc_fops;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1633  	fdev->miscdev.name = devm_kasprintf(dev, GFP_KERNEL, "fastrpc-%s", domain);
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1634  	err = misc_register(&fdev->miscdev);
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1635  	if (err)
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26 @1636  		kfree(fdev);
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1637  	else
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1638  		cctx->fdevice = fdev;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1639  
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1640  	return err;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1641  }
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1642  

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

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v3 01/12] misc: fastrpc: separate fastrpc device from channel context
Date: Thu, 27 Jan 2022 14:33:50 +0300	[thread overview]
Message-ID: <202201271857.MGiOkhFo-lkp@intel.com> (raw)
In-Reply-To: <20220126135304.16340-2-srinivas.kandagatla@linaro.org>

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

Hi Srinivas,

url:    https://github.com/0day-ci/linux/commits/Srinivas-Kandagatla/misc-fastrpc-Add-missing-DSP-FastRPC-features/20220126-215705
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 515a2f507491e7c3818e74ef4f4e088c1fecb190
config: openrisc-randconfig-m031-20220124 (https://download.01.org/0day-ci/archive/20220127/202201271857.MGiOkhFo-lkp(a)intel.com/config)
compiler: or1k-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>

New smatch warnings:
drivers/misc/fastrpc.c:1636 fastrpc_device_register() warn: passing devm_ allocated variable to kfree. 'fdev'

vim +/fdev +1636 drivers/misc/fastrpc.c

99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1620  static int fastrpc_device_register(struct device *dev, struct fastrpc_channel_ctx *cctx,
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1621  				   const char *domain)
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1622  {
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1623  	struct fastrpc_device *fdev;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1624  	int err;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1625  
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1626  	fdev = devm_kzalloc(dev, sizeof(*fdev), GFP_KERNEL);
                                                        ^^^^^^^^^^^^^^^^^^^

99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1627  	if (!fdev)
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1628  		return -ENOMEM;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1629  
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1630  	fdev->cctx = cctx;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1631  	fdev->miscdev.minor = MISC_DYNAMIC_MINOR;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1632  	fdev->miscdev.fops = &fastrpc_fops;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1633  	fdev->miscdev.name = devm_kasprintf(dev, GFP_KERNEL, "fastrpc-%s", domain);
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1634  	err = misc_register(&fdev->miscdev);
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1635  	if (err)
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26 @1636  		kfree(fdev);
                                                                ^^^^^^^^^^^
Double free

99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1637  	else
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1638  		cctx->fdevice = fdev;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1639  
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1640  	return err;
99d9d7a1c5f2dae Srinivas Kandagatla 2022-01-26  1641  }

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

       reply	other threads:[~2022-01-27 11:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 10:15 kernel test robot [this message]
2022-01-27 11:33 ` [PATCH v3 01/12] misc: fastrpc: separate fastrpc device from channel context Dan Carpenter
2022-01-27 11:33 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2022-01-27 13:09 [PATCH v3 11/12] misc: fastrpc: Add dma handle implementation kernel test robot
2022-01-28  7:09 ` Dan Carpenter
2022-01-28  7:09 ` Dan Carpenter
2022-01-26 13:52 [PATCH v3 00/12] misc: fastrpc: Add missing DSP FastRPC features Srinivas Kandagatla
2022-01-26 13:52 ` [PATCH v3 01/12] misc: fastrpc: separate fastrpc device from channel context Srinivas Kandagatla
2022-01-26 13:52 ` [PATCH v3 02/12] misc: fastrpc: add support for FASTRPC_IOCTL_MEM_MAP/UNMAP Srinivas Kandagatla
2022-01-26 18:00   ` kernel test robot
2022-01-26 18:00     ` kernel test robot
2022-01-27  4:48   ` kernel test robot
2022-01-27  4:48     ` kernel test robot
2022-01-26 13:52 ` [PATCH v3 03/12] misc: fastrpc: Add support to get DSP capabilities Srinivas Kandagatla
2022-01-26 21:04   ` kernel test robot
2022-01-26 21:04     ` kernel test robot
2022-01-26 13:52 ` [PATCH v3 04/12] dt-bindings: misc: add property to support non-secure DSP Srinivas Kandagatla
2022-02-07 20:44   ` Rob Herring
2022-01-26 13:52 ` [PATCH v3 05/12] misc: fastrpc: add secure domain support Srinivas Kandagatla
2022-01-26 13:52 ` [PATCH v3 06/12] misc: fastrpc: check before loading process to the DSP Srinivas Kandagatla
2022-01-26 13:52 ` [PATCH v3 07/12] dt-bindings: misc: add fastrpc domain vmid property Srinivas Kandagatla
2022-02-07 20:45   ` Rob Herring
2022-01-26 13:53 ` [PATCH v3 08/12] misc: fastrpc: Add support to secure memory map Srinivas Kandagatla
2022-01-26 13:53 ` [PATCH v3 09/12] misc: fastrpc: Add helper function to get list and page Srinivas Kandagatla
2022-01-26 13:53 ` [PATCH v3 10/12] misc: fastrpc: Add fdlist implementation Srinivas Kandagatla
2022-01-26 13:53 ` [PATCH v3 11/12] misc: fastrpc: Add dma handle implementation Srinivas Kandagatla
2022-01-26 20:13   ` kernel test robot
2022-01-26 20:13     ` kernel test robot
2022-01-26 20:14   ` kernel test robot
2022-01-26 20:14     ` kernel test robot
2022-01-26 13:53 ` [PATCH v3 12/12] arm64: dts: qcom: add non-secure domain property to fastrpc nodes Srinivas Kandagatla
2022-04-08 13:37 ` [PATCH v3 00/12] misc: fastrpc: Add missing DSP FastRPC features patchwork-bot+linux-arm-msm

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=202201271857.MGiOkhFo-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=bkumar@qti.qualcomm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ekangupt@qti.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=robh+dt@kernel.org \
    --cc=srini@kernel.org \
    --cc=srinivas.kandagatla@linaro.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.