lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 3 Dec 2021 16:01:37 +0100
From:   Marc Kleine-Budde <mkl@...gutronix.de>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     kbuild@...ts.01.org,
        Stephane Grosjean <s.grosjean@...k-system.com>, lkp@...el.com,
        kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        linux-can <linux-can@...r.kernel.org>
Subject: Re: drivers/net/can/usb/peak_usb/pcan_usb.c:523
 pcan_usb_decode_error() error: we previously assumed 'cf' could be null (see
 line 503)

On 03.12.2021 15:58:52, Marc Kleine-Budde wrote:
> On 03.12.2021 17:09:55, Dan Carpenter wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   58e1100fdc5990b0cc0d4beaf2562a92e621ac7d
> > commit: c11dcee758302702a83c6e85e4c4c3d9af42d2b3 can: peak_usb: pcan_usb_decode_error(): upgrade handling of bus state changes
> > config: x86_64-randconfig-m001-20211202 (https://download.01.org/0day-ci/archive/20211202/202112021833.wABxM5UN-lkp@intel.com/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@...el.com>
> > Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> > 
> > smatch warnings:
> > drivers/net/can/usb/peak_usb/pcan_usb.c:523 pcan_usb_decode_error() error: we previously assumed 'cf' could be null (see line 503)
> > 
> > vim +/cf +523 drivers/net/can/usb/peak_usb/pcan_usb.c
> > 
> > 46be265d338833 Stephane Grosjean 2012-03-02  450  static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n,
> > 46be265d338833 Stephane Grosjean 2012-03-02  451  				 u8 status_len)
> > 46be265d338833 Stephane Grosjean 2012-03-02  452  {
> > 46be265d338833 Stephane Grosjean 2012-03-02  453  	struct sk_buff *skb;
> > 46be265d338833 Stephane Grosjean 2012-03-02  454  	struct can_frame *cf;
> > c11dcee7583027 Stephane Grosjean 2021-07-15  455  	enum can_state new_state = CAN_STATE_ERROR_ACTIVE;
> > 46be265d338833 Stephane Grosjean 2012-03-02  456  
> > 46be265d338833 Stephane Grosjean 2012-03-02  457  	/* ignore this error until 1st ts received */
> > 46be265d338833 Stephane Grosjean 2012-03-02  458  	if (n == PCAN_USB_ERROR_QOVR)
> > 46be265d338833 Stephane Grosjean 2012-03-02  459  		if (!mc->pdev->time_ref.tick_count)
> > 46be265d338833 Stephane Grosjean 2012-03-02  460  			return 0;
> > 46be265d338833 Stephane Grosjean 2012-03-02  461  
> > c11dcee7583027 Stephane Grosjean 2021-07-15  462  	/* allocate an skb to store the error frame */
> > c11dcee7583027 Stephane Grosjean 2021-07-15  463  	skb = alloc_can_err_skb(mc->netdev, &cf);
> 
> alloc_can_err_skb() ->
> alloc_canfd_skb()

Doh! It calls alloc_can_skb()

https://elixir.bootlin.com/linux/v5.15/source/drivers/net/can/dev/skb.c#L180

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ