All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Bjorn Andersson <andersson@kernel.org>,
	Rex Nie <rex.nie@jaguarmicro.com>
Cc: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org,
	linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, angus.chen@jaguarmicro.com
Subject: Re: [PATCH] usb: typec: qcom-pmic: fix uninitialized value hdr_len and txbuf_len
Date: Tue, 29 Oct 2024 15:38:10 +0000	[thread overview]
Message-ID: <b177e736-e640-47ed-9f1e-ee65971dfc9c@linaro.org> (raw)
In-Reply-To: <q5vuljnuhhasjbexc2aphfd3bzykz3v43sx2bb7vu5h5zacb4y@gvzbthmmg6wj>

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

  reply	other threads:[~2024-10-29 15:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29  2:18 [PATCH] usb: typec: qcom-pmic: fix uninitialized value hdr_len and txbuf_len Rex Nie
2024-10-29  2:30 ` Greg KH
2024-10-29  6:28   ` 答复: " Rex Nie
2024-10-29 15:28 ` Bjorn Andersson
2024-10-29 15:38   ` Bryan O'Donoghue [this message]
2024-10-30  2:27 ` [PATCH v2] usb: typec: qcom-pmic: init value of hdr_len/txbuf_len earlier Rex Nie
2024-10-30  8:39   ` Heikki Krogerus
2024-10-30 10:35     ` 答复: " Rex Nie
2024-10-30 10:32   ` [PATCH v3] " Rex Nie
2024-10-30 12:31     ` Bryan O'Donoghue
2024-10-30 13:19     ` Heikki Krogerus
2024-10-30 13:37       ` 答复: " Rex Nie
2024-10-30 13:36   ` [PATCH v4] " Rex Nie
2024-10-31 10:56     ` Heikki Krogerus
2024-11-01 15:45     ` Bjorn Andersson
2024-11-02 12:27       ` 答复: " Rex Nie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b177e736-e640-47ed-9f1e-ee65971dfc9c@linaro.org \
    --to=bryan.odonoghue@linaro.org \
    --cc=andersson@kernel.org \
    --cc=angus.chen@jaguarmicro.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rex.nie@jaguarmicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.