[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220721071201.269344-2-yangyingliang@huawei.com>
Date: Thu, 21 Jul 2022 15:12:00 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <linux-kernel@...r.kernel.org>, <linux-usb@...r.kernel.org>
CC: <heikki.krogerus@...ux.intel.com>, <gregkh@...uxfoundation.org>
Subject: [PATCH -next 2/3] usb: typec: anx7411: Fix return value check in anx7411_register_i2c_dummy_clients()
If i2c_new_dummy_device() fails, it never return NULL pointer, replace
NULL test with IS_ERR() to fix it.
Fixes: fe6d8a9c8e64 ("usb: typec: anx7411: Add Analogix PD ANX7411 support")
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
drivers/usb/typec/anx7411.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/typec/anx7411.c b/drivers/usb/typec/anx7411.c
index 1ffab17a9b17..4816f5d24ac3 100644
--- a/drivers/usb/typec/anx7411.c
+++ b/drivers/usb/typec/anx7411.c
@@ -999,7 +999,7 @@ static int anx7411_register_i2c_dummy_clients(struct anx7411_data *ctx,
spi_addr = anx7411_i2c_addr[i].spi_address >> 1;
ctx->spi_client = i2c_new_dummy_device(client->adapter,
spi_addr);
- if (ctx->spi_client)
+ if (!IS_ERR(ctx->spi_client))
return 0;
}
}
--
2.25.1
Powered by blists - more mailing lists