X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH platform-next v2 1/1] platform/mellanox: mlxreg-dpu: Fix smatch warnings
@ 2025-05-08 20:31 Vadim Pasternak
  2025-05-11 20:46 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: Vadim Pasternak @ 2025-05-08 20:31 UTC (permalink / raw)
  To: hdegoede, ilpo.jarvinen
  Cc: michaelsh, dan.carpenter, platform-driver-x86, Vadim Pasternak

Add missed call to release adapter.
Remove wrong error pointer conversion.

Fixes: 3e75f2954116 ("platform/mellanox: mlxreg-dpu: Add initial support for Nvidia DPU")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
---
v0->v2:
Comment pointed out by Ilpo:
- Reuse the existing rollback for error flow.
---
 drivers/platform/mellanox/mlxreg-dpu.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/mellanox/mlxreg-dpu.c b/drivers/platform/mellanox/mlxreg-dpu.c
index 277e4b8cc5cb..52260106a9f1 100644
--- a/drivers/platform/mellanox/mlxreg-dpu.c
+++ b/drivers/platform/mellanox/mlxreg-dpu.c
@@ -535,8 +535,10 @@ static int mlxreg_dpu_probe(struct platform_device *pdev)
 		return -EPROBE_DEFER;
 
 	mlxreg_dpu = devm_kzalloc(&pdev->dev, sizeof(*mlxreg_dpu), GFP_KERNEL);
-	if (!mlxreg_dpu)
-		return -ENOMEM;
+	if (!mlxreg_dpu) {
+		err = -ENOMEM;
+		goto alloc_fail;
+	}
 
 	/* Create device at the top of DPU I2C tree. */
 	data->hpdev.client = i2c_new_client_device(data->hpdev.adapter,
@@ -562,7 +564,6 @@ static int mlxreg_dpu_probe(struct platform_device *pdev)
 	if (err) {
 		dev_err(&pdev->dev, "Failed to sync regmap for client %s at bus %d at addr 0x%02x\n",
 			data->hpdev.brdinfo->type, data->hpdev.nr, data->hpdev.brdinfo->addr);
-		err = PTR_ERR(regmap);
 		goto regcache_sync_fail;
 	}
 
@@ -581,6 +582,7 @@ static int mlxreg_dpu_probe(struct platform_device *pdev)
 devm_regmap_init_i2c_fail:
 	i2c_unregister_device(data->hpdev.client);
 i2c_new_device_fail:
+alloc_fail:
 	i2c_put_adapter(data->hpdev.adapter);
 	return err;
 }
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH platform-next v2 1/1] platform/mellanox: mlxreg-dpu: Fix smatch warnings
  2025-05-08 20:31 [PATCH platform-next v2 1/1] platform/mellanox: mlxreg-dpu: Fix smatch warnings Vadim Pasternak
@ 2025-05-11 20:46 ` Ilpo Järvinen
  0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-05-11 20:46 UTC (permalink / raw)
  To: hdegoede, Vadim Pasternak; +Cc: michaelsh, dan.carpenter, platform-driver-x86

On Thu, 08 May 2025 23:31:39 +0300, Vadim Pasternak wrote:

> Add missed call to release adapter.
> Remove wrong error pointer conversion.
> 
> 


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/mellanox: mlxreg-dpu: Fix smatch warnings
      commit: f94ffc3f0b90bf4880e0abf2c056fc465e2c3be8

--
 i.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-11 20:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-08 20:31 [PATCH platform-next v2 1/1] platform/mellanox: mlxreg-dpu: Fix smatch warnings Vadim Pasternak
2025-05-11 20:46 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox