qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH] misc/pca9554: Fix check of pin range value in property acces


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] misc/pca9554: Fix check of pin range value in property accessors
Date: Thu, 21 Mar 2024 18:15:39 +0100
User-agent: Mozilla Thunderbird

On 21/3/24 17:01, Cédric Le Goater wrote:
Coverity detected an "Integer handling" issue with the pin value :

   In expression "state >> pin", right shifting "state" by more than 7
   bits always yields zero.  The shift amount, "pin", is as much as 8.

In practice, this should not happen because the properties "pin8" and
above are not created. Nevertheless, fix the range to avoid this warning.

Fixes: CID 1534917
Fixes: de0c7d543bca ("misc: Add a pca9554 GPIO device model")
Cc: Glenn Miles <milesg@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
  hw/misc/pca9554.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Isn't it the one Peter fixed in
https://lore.kernel.org/qemu-devel/20240312183810.557768-5-peter.maydell@linaro.org/?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]