Patch "usb: typec: wcove: Use LE to CPU conversion when accessing msg->header" has been added to the 4.19-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    usb: typec: wcove: Use LE to CPU conversion when accessing msg->header

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-typec-wcove-use-le-to-cpu-conversion-when-access.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5656139ec7aada056ef23e31066525cf48879043
Author: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Date:   Wed Jun 9 20:22:02 2021 +0300

    usb: typec: wcove: Use LE to CPU conversion when accessing msg->header
    
    [ Upstream commit d5ab95da2a41567440097c277c5771ad13928dad ]
    
    As LKP noticed the Sparse is not happy about strict type handling:
       .../typec/tcpm/wcove.c:380:50: sparse:     expected unsigned short [usertype] header
       .../typec/tcpm/wcove.c:380:50: sparse:     got restricted __le16 const [usertype] header
    
    Fix this by switching to use pd_header_cnt_le() instead of pd_header_cnt()
    in the affected code.
    
    Fixes: ae8a2ca8a221 ("usb: typec: Group all TCPCI/TCPM code together")
    Fixes: 3c4fb9f16921 ("usb: typec: wcove: start using tcpm for USB PD support")
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
    Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210609172202.83377-1-andriy.shevchenko@xxxxxxxxxxxxxxx
    Cc: stable <stable@xxxxxxxxxxxxxxx>
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/typec/tcpm/wcove.c b/drivers/usb/typec/tcpm/wcove.c
index f1f8f45e2f3dc..ca3af15a1f9e8 100644
--- a/drivers/usb/typec/tcpm/wcove.c
+++ b/drivers/usb/typec/tcpm/wcove.c
@@ -377,7 +377,7 @@ static int wcove_pd_transmit(struct tcpc_dev *tcpc,
 		const u8 *data = (void *)msg;
 		int i;
 
-		for (i = 0; i < pd_header_cnt(msg->header) * 4 + 2; i++) {
+		for (i = 0; i < pd_header_cnt_le(msg->header) * 4 + 2; i++) {
 			ret = regmap_write(wcove->regmap, USBC_TX_DATA + i,
 					   data[i]);
 			if (ret)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux