Re: [PATCH net-next v8 2/2] net: Add Qcom WWAN control driver (fwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is a clear use after free on line 213.

julia

---------- Forwarded message ----------
Date: Sat, 3 Apr 2021 04:42:45 +0800
From: kernel test robot <lkp@xxxxxxxxx>
To: kbuild@xxxxxxxxxxxx
Cc: lkp@xxxxxxxxx, Julia Lawall <julia.lawall@xxxxxxx>
Subject: Re: [PATCH net-next v8 2/2] net: Add Qcom WWAN control driver

CC: kbuild-all@xxxxxxxxxxxx
In-Reply-To: <1617372397-13988-2-git-send-email-loic.poulain@xxxxxxxxxx>
References: <1617372397-13988-2-git-send-email-loic.poulain@xxxxxxxxxx>
TO: Loic Poulain <loic.poulain@xxxxxxxxxx>
TO: gregkh@xxxxxxxxxxxxxxxxxxx
TO: kuba@xxxxxxxxxx
TO: davem@xxxxxxxxxxxxx
CC: linux-arm-msm@xxxxxxxxxxxxxxx
CC: aleksander@xxxxxxxxxxxxx
CC: linux-kernel@xxxxxxxxxxxxxxx
CC: netdev@xxxxxxxxxxxxxxx
CC: bjorn.andersson@xxxxxxxxxx
CC: manivannan.sadhasivam@xxxxxxxxxx
CC: Loic Poulain <loic.poulain@xxxxxxxxxx>

Hi Loic,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Loic-Poulain/net-Add-a-WWAN-subsystem/20210402-220002
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git bd78980be1a68d14524c51c4b4170782fada622b
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Julia Lawall <julia.lawall@xxxxxxx>


cocci warnings: (new ones prefixed by >>)
>> drivers/net/wwan/mhi_wwan_ctrl.c:213:17-24: ERROR: reference preceded by free on line 212

vim +213 drivers/net/wwan/mhi_wwan_ctrl.c

16d753f4f524ce Loic Poulain 2021-04-02  184
16d753f4f524ce Loic Poulain 2021-04-02  185  static int mhi_wwan_ctrl_probe(struct mhi_device *mhi_dev,
16d753f4f524ce Loic Poulain 2021-04-02  186  			       const struct mhi_device_id *id)
16d753f4f524ce Loic Poulain 2021-04-02  187  {
16d753f4f524ce Loic Poulain 2021-04-02  188  	struct mhi_controller *cntrl = mhi_dev->mhi_cntrl;
16d753f4f524ce Loic Poulain 2021-04-02  189  	struct mhi_wwan_dev *mhiwwan;
16d753f4f524ce Loic Poulain 2021-04-02  190
16d753f4f524ce Loic Poulain 2021-04-02  191  	mhiwwan = kzalloc(sizeof(*mhiwwan), GFP_KERNEL);
16d753f4f524ce Loic Poulain 2021-04-02  192  	if (!mhiwwan)
16d753f4f524ce Loic Poulain 2021-04-02  193  		return -ENOMEM;
16d753f4f524ce Loic Poulain 2021-04-02  194
16d753f4f524ce Loic Poulain 2021-04-02  195  	mhiwwan->mhi_dev = mhi_dev;
16d753f4f524ce Loic Poulain 2021-04-02  196  	mhiwwan->mtu = MHI_WWAN_MAX_MTU;
16d753f4f524ce Loic Poulain 2021-04-02  197  	INIT_WORK(&mhiwwan->rx_refill, mhi_wwan_ctrl_refill_work);
16d753f4f524ce Loic Poulain 2021-04-02  198  	spin_lock_init(&mhiwwan->tx_lock);
16d753f4f524ce Loic Poulain 2021-04-02  199
16d753f4f524ce Loic Poulain 2021-04-02  200  	if (mhi_dev->dl_chan)
16d753f4f524ce Loic Poulain 2021-04-02  201  		set_bit(MHI_WWAN_DL_CAP, &mhiwwan->flags);
16d753f4f524ce Loic Poulain 2021-04-02  202  	if (mhi_dev->ul_chan)
16d753f4f524ce Loic Poulain 2021-04-02  203  		set_bit(MHI_WWAN_UL_CAP, &mhiwwan->flags);
16d753f4f524ce Loic Poulain 2021-04-02  204
16d753f4f524ce Loic Poulain 2021-04-02  205  	dev_set_drvdata(&mhi_dev->dev, mhiwwan);
16d753f4f524ce Loic Poulain 2021-04-02  206
16d753f4f524ce Loic Poulain 2021-04-02  207  	/* Register as a wwan port, id->driver_data contains wwan port type */
16d753f4f524ce Loic Poulain 2021-04-02  208  	mhiwwan->wwan_port = wwan_create_port(&cntrl->mhi_dev->dev,
16d753f4f524ce Loic Poulain 2021-04-02  209  					      id->driver_data,
16d753f4f524ce Loic Poulain 2021-04-02  210  					      &wwan_pops, mhiwwan);
16d753f4f524ce Loic Poulain 2021-04-02  211  	if (IS_ERR(mhiwwan->wwan_port)) {
16d753f4f524ce Loic Poulain 2021-04-02 @212  		kfree(mhiwwan);
16d753f4f524ce Loic Poulain 2021-04-02 @213  		return PTR_ERR(mhiwwan->wwan_port);
16d753f4f524ce Loic Poulain 2021-04-02  214  	}
16d753f4f524ce Loic Poulain 2021-04-02  215
16d753f4f524ce Loic Poulain 2021-04-02  216  	return 0;
16d753f4f524ce Loic Poulain 2021-04-02  217  };
16d753f4f524ce Loic Poulain 2021-04-02  218

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux