All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo+renesas@jmondi.org>
To: linux-renesas-soc@vger.kernel.org,
	kieran.bingham+renesas@ideasonboard.com
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: [PATCH] squash! i2c: max9286: Put of node on error
Date: Thu,  9 Apr 2020 19:08:06 +0200	[thread overview]
Message-ID: <20200409170806.1842811-1-jacopo+renesas@jmondi.org> (raw)
In-Reply-To: <20200409121202.11130-3-kieran.bingham+renesas@ideasonboard.com>

Put the device of node in case of dt parsing error.

Fixes: 9eed4185c7a0 ("media: i2c: Add MAX9286 driver")
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
 drivers/media/i2c/max9286.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index 241deed0f270..bac9696f83b4 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -1121,6 +1121,7 @@ static int max9286_parse_dt(struct max9286_priv *priv)
 	i2c_mux = of_find_node_by_name(dev->of_node, "i2c-mux");
 	if (!i2c_mux) {
 		dev_err(dev, "Failed to find i2c-mux node\n");
+		of_node_put(dev->of_node);
 		return -EINVAL;
 	}

@@ -1168,6 +1169,7 @@ static int max9286_parse_dt(struct max9286_priv *priv)
 					of_fwnode_handle(node), &vep);
 			if (ret) {
 				of_node_put(node);
+				of_node_put(dev->of_node);
 				return ret;
 			}

@@ -1177,6 +1179,7 @@ static int max9286_parse_dt(struct max9286_priv *priv)
 					vep.bus_type);
 				v4l2_fwnode_endpoint_free(&vep);
 				of_node_put(node);
+				of_node_put(dev->of_node);
 				return -EINVAL;
 			}

@@ -1214,6 +1217,7 @@ static int max9286_parse_dt(struct max9286_priv *priv)
 		priv->nsources++;
 	}
 	of_node_put(node);
+	of_node_put(dev->of_node);

 	priv->route_mask = priv->source_mask;

--
2.26.0


  parent reply	other threads:[~2020-04-09 17:05 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 12:11 [PATCH v8 00/13] max9286 v8 - modifications Kieran Bingham
2020-04-09 12:11 ` [PATCH v8 01/13] squash! max9286: Update the bound_sources mask on unbind Kieran Bingham
2020-04-09 15:20   ` Jacopo Mondi
2020-04-09 12:11 ` [PATCH v8 02/13] squash! max9286: convert probe kzalloc Kieran Bingham
2020-04-09 16:33   ` Laurent Pinchart
2020-04-10  8:20     ` Kieran Bingham
2020-04-10 11:15       ` Laurent Pinchart
2020-04-23  7:38         ` Sakari Ailus
2020-04-23  9:32           ` Laurent Pinchart
2020-04-23 10:55           ` Kieran Bingham
2020-04-23 23:25             ` Sakari Ailus
2020-04-09 17:08   ` Jacopo Mondi [this message]
2020-04-09 20:20     ` [PATCH] squash! i2c: max9286: Put of node on error Jacopo Mondi
2020-04-10  7:20       ` Kieran Bingham
2020-04-09 12:11 ` [PATCH v8 03/13] squash! max9286: Fix cleanup path from GPIO powerdown Kieran Bingham
2020-04-09 16:22   ` Jacopo Mondi
2020-04-10  7:34     ` Geert Uytterhoeven
2020-04-10  7:41       ` Kieran Bingham
2020-04-10  7:52       ` Jacopo Mondi
2020-04-10  7:38     ` Kieran Bingham
2020-04-10  7:42       ` Kieran Bingham
2020-04-11 12:33     ` Jacopo Mondi
2020-04-09 12:11 ` [PATCH v8 04/13] squash! max9286: cleanup GPIO device registration fail path Kieran Bingham
2020-04-09 12:11 ` [PATCH v8 05/13] squash! max9286: Convert to use devm_regulator_get() Kieran Bingham
2020-04-09 12:15   ` Kieran Bingham
2020-04-09 12:11 ` [PATCH v8 06/13] squash! max9286: Fit max9286_parse_dt print on one line Kieran Bingham
2020-04-09 12:11 ` [PATCH v8 07/13] squash! max9286: Move multi-device workarounds out of upstream Kieran Bingham
2020-04-09 12:11 ` [PATCH v8 08/13] squash! max9286: Remove I2C mod-table Kieran Bingham
2020-04-09 12:11 ` [PATCH v8 09/13] sqaush! max9286: Lock format changes Kieran Bingham
2020-04-09 12:11 ` [PATCH v8 10/13] squash! max9286: Implement Pixelrate control Kieran Bingham
2020-04-09 16:29   ` Jacopo Mondi
2020-04-10  7:51     ` Kieran Bingham
2020-04-10 12:35       ` Jacopo Mondi
2020-04-14 10:50   ` Jacopo Mondi
2020-04-14 21:10     ` Laurent Pinchart
2020-04-15  9:13       ` Jacopo Mondi
2020-04-15 15:28         ` Laurent Pinchart
2020-04-09 12:12 ` [PATCH v8 11/13] squash! max9286: Disable overlap window Kieran Bingham
2020-04-09 16:32   ` Jacopo Mondi
2020-04-10  7:14     ` Kieran Bingham
2020-04-10  7:48       ` Jacopo Mondi
2020-04-09 12:12 ` [PATCH v8 12/13] sqaush! max9286: Describe pad index usage Kieran Bingham
2020-04-09 12:12 ` [PATCH v8 13/13] sqaush! max9286: Remove poc_enabled workaround Kieran Bingham
2020-04-09 16:33   ` Jacopo Mondi

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=20200409170806.1842811-1-jacopo+renesas@jmondi.org \
    --to=jacopo+renesas@jmondi.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.