qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 3/5] tools/vhost-user-i2c: Add backend driver


From: Viresh Kumar
Subject: Re: [PATCH 3/5] tools/vhost-user-i2c: Add backend driver
Date: Thu, 25 Mar 2021 12:06:49 +0530
User-agent: NeoMutt/20180716-391-311a52

On 25-03-21, 14:17, Jie Deng wrote:
> i2c->adapter_num is set here, but used in vi2c_remove_adapters.
> when you goto out from while {...}, i2c->adapter_num is always 0,
> May be a bug ?

It certainly is, this should fix it:

diff --git a/tools/vhost-user-i2c/main.c b/tools/vhost-user-i2c/main.c
index 071493cbd5c5..65d27ef04d42 100644
--- a/tools/vhost-user-i2c/main.c
+++ b/tools/vhost-user-i2c/main.c
@@ -202,7 +202,7 @@ static void vi2c_remove_adapters(VuI2c *i2c)
     VI2cAdapter *adapter;
     int32_t i;
 
-    for (i = 0; i < i2c->adapter_num; i++) {
+    for (i = 0; i < MAX_I2C_ADAPTER; i++) {
         adapter = i2c->adapter[i];
         if (!adapter) {
             break;

-- 
viresh



reply via email to

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