Re: [PATCH 1/3] USB: serial: return errors from break handling

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

 



Hi Johan,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Johan-Hovold/USB-serial-return-errors-from-break-handling/20230602-204856
base:   https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git usb-next
patch link:    https://lore.kernel.org/r/20230602124642.19076-2-johan%40kernel.org
patch subject: [PATCH 1/3] USB: serial: return errors from break handling
config: i386-randconfig-m021-20230531 (https://download.01.org/0day-ci/archive/20230603/202306031014.qzAY3uQ6-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <error27@xxxxxxxxx>
| Closes: https://lore.kernel.org/r/202306031014.qzAY3uQ6-lkp@xxxxxxxxx/

New smatch warnings:
drivers/usb/serial/io_edgeport.c:1601 edge_break() error: uninitialized symbol 'status'.

vim +/status +1601 drivers/usb/serial/io_edgeport.c

12992379710489 Johan Hovold       2023-06-02  1563  static int edge_break(struct tty_struct *tty, int break_state)
^1da177e4c3f41 Linus Torvalds     2005-04-16  1564  {
95da310e66ee80 Alan Cox           2008-07-22  1565  	struct usb_serial_port *port = tty->driver_data;
^1da177e4c3f41 Linus Torvalds     2005-04-16  1566  	struct edgeport_port *edge_port = usb_get_serial_port_data(port);
6e8cf7751f9fb9 Greg Kroah-Hartman 2007-01-18  1567  	struct edgeport_serial *edge_serial = usb_get_serial_data(port->serial);
^1da177e4c3f41 Linus Torvalds     2005-04-16  1568  	int status;
^1da177e4c3f41 Linus Torvalds     2005-04-16  1569  
232dce89b5b000 Geyslan G. Bem     2015-12-11  1570  	if (!edge_serial->is_epic ||
232dce89b5b000 Geyslan G. Bem     2015-12-11  1571  	    edge_serial->epic_descriptor.Supports.IOSPChase) {
^1da177e4c3f41 Linus Torvalds     2005-04-16  1572  		/* flush and chase */
cb8eaa8b2b9133 Richard Knutsson   2007-03-17  1573  		edge_port->chaseResponsePending = true;
^1da177e4c3f41 Linus Torvalds     2005-04-16  1574  
984f68683298ba Greg Kroah-Hartman 2012-09-18  1575  		dev_dbg(&port->dev, "%s - Sending IOSP_CMD_CHASE_PORT\n", __func__);
^1da177e4c3f41 Linus Torvalds     2005-04-16  1576  		status = send_iosp_ext_cmd(edge_port, IOSP_CMD_CHASE_PORT, 0);
^1da177e4c3f41 Linus Torvalds     2005-04-16  1577  		if (status == 0) {
03f0dbf74c7a11 Alan Cox           2008-07-22  1578  			/* block until chase finished */
^1da177e4c3f41 Linus Torvalds     2005-04-16  1579  			block_until_chase_response(edge_port);
^1da177e4c3f41 Linus Torvalds     2005-04-16  1580  		} else {
cb8eaa8b2b9133 Richard Knutsson   2007-03-17  1581  			edge_port->chaseResponsePending = false;
^1da177e4c3f41 Linus Torvalds     2005-04-16  1582  		}
6e8cf7751f9fb9 Greg Kroah-Hartman 2007-01-18  1583  	}
^1da177e4c3f41 Linus Torvalds     2005-04-16  1584  
232dce89b5b000 Geyslan G. Bem     2015-12-11  1585  	if (!edge_serial->is_epic ||
232dce89b5b000 Geyslan G. Bem     2015-12-11  1586  	    edge_serial->epic_descriptor.Supports.IOSPSetClrBreak) {
^1da177e4c3f41 Linus Torvalds     2005-04-16  1587  		if (break_state == -1) {
984f68683298ba Greg Kroah-Hartman 2012-09-18  1588  			dev_dbg(&port->dev, "%s - Sending IOSP_CMD_SET_BREAK\n", __func__);
03f0dbf74c7a11 Alan Cox           2008-07-22  1589  			status = send_iosp_ext_cmd(edge_port,
03f0dbf74c7a11 Alan Cox           2008-07-22  1590  						IOSP_CMD_SET_BREAK, 0);
^1da177e4c3f41 Linus Torvalds     2005-04-16  1591  		} else {
984f68683298ba Greg Kroah-Hartman 2012-09-18  1592  			dev_dbg(&port->dev, "%s - Sending IOSP_CMD_CLEAR_BREAK\n", __func__);
03f0dbf74c7a11 Alan Cox           2008-07-22  1593  			status = send_iosp_ext_cmd(edge_port,
03f0dbf74c7a11 Alan Cox           2008-07-22  1594  						IOSP_CMD_CLEAR_BREAK, 0);
^1da177e4c3f41 Linus Torvalds     2005-04-16  1595  		}

"status" uninitialized on else path.

03f0dbf74c7a11 Alan Cox           2008-07-22  1596  		if (status)
984f68683298ba Greg Kroah-Hartman 2012-09-18  1597  			dev_dbg(&port->dev, "%s - error sending break set/clear command.\n",
03f0dbf74c7a11 Alan Cox           2008-07-22  1598  				__func__);
6e8cf7751f9fb9 Greg Kroah-Hartman 2007-01-18  1599  	}
12992379710489 Johan Hovold       2023-06-02  1600  
12992379710489 Johan Hovold       2023-06-02 @1601  	return status;
^1da177e4c3f41 Linus Torvalds     2005-04-16  1602  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux