]> git.baikalelectronics.ru Git - kernel.git/commit
usb: typec: tcpm: usb: typec: tcpm: Fix a signedness bug in tcpm_fw_get_caps()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 1 Oct 2019 12:01:17 +0000 (15:01 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2019 09:06:47 +0000 (11:06 +0200)
commit9673f533a0c6abbdd5a2e005160644eb4693b96e
tree2d5779546b084f5ee55ea61a22f33b8f71cae930
parent73b09b1cdd305abeb38658c0998c99d10e88449a
usb: typec: tcpm: usb: typec: tcpm: Fix a signedness bug in tcpm_fw_get_caps()

The "port->typec_caps.data" and "port->typec_caps.type" variables are
enums and in this context GCC will treat them as an unsigned int so they
can never be less than zero.

Fixes: b879e49658b1 ("usb: typec: Group all TCPCI/TCPM code together")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20191001120117.GA23528@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c