public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH] iommu/mediatek: fix NULL pointer dereference when printing dev_name
       [not found] <20220422223549.4173-1-miles.chen@mediatek.com>
@ 2022-04-23  6:49 ` kernel test robot
  2022-04-24 23:28   ` Miles Chen
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-04-23  6:49 UTC (permalink / raw)
  To: Miles Chen, Yong Wu, Joerg Roedel, Will Deacon, Matthias Brugger,
	Mauro Carvalho Chehab, Hans Verkuil, AngeloGioacchino Del Regno
  Cc: llvm, kbuild-all, linux-media, Miles Chen, iommu, linux-mediatek,
	linux-arm-kernel, linux-kernel

Hi Miles,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on joro-iommu/next]
[also build test WARNING on v5.18-rc3 next-20220422]
[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/intel-lab-lkp/linux/commits/Miles-Chen/iommu-mediatek-fix-NULL-pointer-dereference-when-printing-dev_name/20220423-070605
base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
config: hexagon-randconfig-r041-20220422 (https://download.01.org/0day-ci/archive/20220423/202204231446.IYKdZ674-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/85771767e503ca60069fe4e6ec2ddb80c7f9bafa
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Miles-Chen/iommu-mediatek-fix-NULL-pointer-dereference-when-printing-dev_name/20220423-070605
        git checkout 85771767e503ca60069fe4e6ec2ddb80c7f9bafa
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/iommu/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/iommu/mtk_iommu.c:605:6: warning: variable 'larbdev' is uninitialized when used here [-Wuninitialized]
           if (larbdev) {
               ^~~~~~~
   drivers/iommu/mtk_iommu.c:597:24: note: initialize the variable 'larbdev' to silence this warning
           struct device *larbdev;
                                 ^
                                  = NULL
   1 warning generated.


vim +/larbdev +605 drivers/iommu/mtk_iommu.c

   592	
   593	static void mtk_iommu_release_device(struct device *dev)
   594	{
   595		struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
   596		struct mtk_iommu_data *data;
   597		struct device *larbdev;
   598		unsigned int larbid;
   599	
   600		if (!fwspec || fwspec->ops != &mtk_iommu_ops)
   601			return;
   602	
   603		data = dev_iommu_priv_get(dev);
   604		larbid = MTK_M4U_TO_LARB(fwspec->ids[0]);
 > 605		if (larbdev) {
   606			larbdev = data->larb_imu[larbid].dev;
   607			device_link_remove(dev, larbdev);
   608		}
   609	
   610		iommu_fwspec_free(dev);
   611	}
   612	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* Re: [PATCH] iommu/mediatek: fix NULL pointer dereference when printing dev_name
  2022-04-23  6:49 ` [PATCH] iommu/mediatek: fix NULL pointer dereference when printing dev_name kernel test robot
@ 2022-04-24 23:28   ` Miles Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Miles Chen @ 2022-04-24 23:28 UTC (permalink / raw)
  To: lkp
  Cc: angelogioacchino.delregno, hverkuil, iommu, joro, kbuild-all,
	linux-arm-kernel, linux-kernel, linux-media, linux-mediatek, llvm,
	matthias.bgg, mchehab, miles.chen, will, yong.wu

>Hi Miles,
>
>Thank you for the patch! Perhaps something to improve:
>
>[auto build test WARNING on joro-iommu/next]
>[also build test WARNING on v5.18-rc3 next-20220422]
>[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/intel-lab-lkp/linux/commits/Miles-Chen/iommu-mediatek-fix-NULL-pointer-dereference-when-printing-dev_name/20220423-070605
>base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
>config: hexagon-randconfig-r041-20220422 (https://download.01.org/0day-ci/archive/20220423/202204231446.IYKdZ674-lkp@intel.com/config)
>compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
>reproduce (this is a W=1 build):
>        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>        chmod +x ~/bin/make.cross
>        # https://github.com/intel-lab-lkp/linux/commit/85771767e503ca60069fe4e6ec2ddb80c7f9bafa
>        git remote add linux-review https://github.com/intel-lab-lkp/linux
>        git fetch --no-tags linux-review Miles-Chen/iommu-mediatek-fix-NULL-pointer-dereference-when-printing-dev_name/20220423-070605
>        git checkout 85771767e503ca60069fe4e6ec2ddb80c7f9bafa
>        # save the config file
>        mkdir build_dir && cp config build_dir/.config
>        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/iommu/
>
>If you fix the issue, kindly add following tag as appropriate
>Reported-by: kernel test robot <lkp@intel.com>
>
>All warnings (new ones prefixed by >>):
>
>>> drivers/iommu/mtk_iommu.c:605:6: warning: variable 'larbdev' is uninitialized when used here [-Wuninitialized]
>           if (larbdev) {
>               ^~~~~~~
>   drivers/iommu/mtk_iommu.c:597:24: note: initialize the variable 'larbdev' to silence this warning
>           struct device *larbdev;
>                                 ^
>                                  = NULL
>   1 warning generated.

Thanks for catching this, I will fix this in next version.

thanks,
Miles

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

end of thread, other threads:[~2022-04-24 23:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220422223549.4173-1-miles.chen@mediatek.com>
2022-04-23  6:49 ` [PATCH] iommu/mediatek: fix NULL pointer dereference when printing dev_name kernel test robot
2022-04-24 23:28   ` Miles Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox