X86 platform drivers
 help / color / mirror / Atom feed
From: Vadim Pasternak <vadimp@nvidia.com>
To: <hdegoede@redhat.com>, <ilpo.jarvinen@linux.intel.com>
Cc: <michaelsh@nvidia.com>, <dan.carpenter@linaro.org>,
	<platform-driver-x86@vger.kernel.org>,
	Vadim Pasternak <vadimp@nvidia.com>
Subject: [PATCH platform-next 1/1] platform/mellanox: mlxreg-dpu: Fix smatch warnings
Date: Sun, 4 May 2025 19:54:04 +0300	[thread overview]
Message-ID: <20250504165404.6877-1-vadimp@nvidia.com> (raw)

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>
---
 drivers/platform/mellanox/mlxreg-dpu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/mellanox/mlxreg-dpu.c b/drivers/platform/mellanox/mlxreg-dpu.c
index 277e4b8cc5cb..805b9bfbc85f 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)
+	if (!mlxreg_dpu) {
+		i2c_put_adapter(data->hpdev.adapter);
 		return -ENOMEM;
+	}
 
 	/* 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;
 	}
 
-- 
2.44.0


             reply	other threads:[~2025-05-04 16:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-04 16:54 Vadim Pasternak [this message]
2025-05-05 11:42 ` [PATCH platform-next 1/1] platform/mellanox: mlxreg-dpu: Fix smatch warnings Ilpo Järvinen

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=20250504165404.6877-1-vadimp@nvidia.com \
    --to=vadimp@nvidia.com \
    --cc=dan.carpenter@linaro.org \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=michaelsh@nvidia.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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