mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Zicheng Qu <quzicheng@huawei.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: tanghui20@huawei.com, zhangqiao22@huawei.com, judy.chenhui@huawei.com
Subject: Re: [PATCH] iio: Fix uninitialized symbol 'ret'
Date: Sat, 2 Nov 2024 11:45:13 +0200	[thread overview]
Message-ID: <0c616d01-f90b-472b-bddf-d4441e9159e4@gmail.com> (raw)
In-Reply-To: <1a004693-5dd5-458c-b8ff-b9a978298122@huawei.com>

On 01/11/2024 05:43, Zicheng Qu wrote:
> Hi Matti,
> 
> It might be better but I am not pretty sure whether have to have both 
> gains and times, so I modified 'ret' in places where issues might arise, 
> rather than adding a restriction in iio_gts_sanity_check().

Yes. Thanks for the fix.
> 
> In the corner case, there is a restriction that both num_hwgain and 
> num_itime cannot be 0 simultaneously in the iio_gts_sanity_check(). 

Right. Having both 0 would mean there was nothing at all to handle for 
the GTS.

> However, in the gain_to_scaletables() , if num_itime is 1 and num_hwgain 
> is 0, the 'gain_bytes' becomes 0 and 'all_gains' is not null after the 
> 'for' loop, which causes the subsequent 'while' or 'for' to become 
> ineffective, leading to an undefined 'ret' being returned in the 
> 'free_out'.

Yes. Thank you for the fix :)

Yours,
     -- Matti

      reply	other threads:[~2024-11-02  9:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-31  1:45 Zicheng Qu
2024-10-31  7:13 ` Matti Vaittinen
2024-10-31 21:47   ` Jonathan Cameron
2024-11-02  9:46     ` Matti Vaittinen
2024-11-01  3:43   ` Zicheng Qu
2024-11-02  9:45     ` Matti Vaittinen [this message]

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=0c616d01-f90b-472b-bddf-d4441e9159e4@gmail.com \
    --to=mazziesaccount@gmail.com \
    --cc=judy.chenhui@huawei.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quzicheng@huawei.com \
    --cc=tanghui20@huawei.com \
    --cc=zhangqiao22@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®