Re: [PATCH] usb: typec: qcom-pmic: fix uninitialized value hdr_len and txbuf_len

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

 



On 29/10/2024 15:28, Bjorn Andersson wrote:
+	unsigned int val, hdr_len = 0, txbuf_len = 0, txsize_len;
This stops us from printing uninitialized values, but the error print is
now containing misleading/false data instead.

Yes, the point of the error printout is to also give an indication of what data didn't transmit

        hdr_len = sizeof(msg->header);
        txbuf_len = pd_header_cnt_le(msg->header) * 4;

The default values of the header should probably just be latched @ the top of this routine.

We assume *msg contains valid data so instead of init to zero we should init as above.

Please do that for your V2 including

Fixes: a4422ff22142 (" usb: typec: qcom: Add Qualcomm PMIC Type-C driver")

---
bod




[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