public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rcar-vin: Use of_nodes as specified by the subdev
@ 2017-04-25 14:55 Kieran Bingham
  2017-04-26  7:23 ` Simon Horman
  2017-04-27 22:49 ` Niklas Söderlund
  0 siblings, 2 replies; 7+ messages in thread
From: Kieran Bingham @ 2017-04-25 14:55 UTC (permalink / raw)
  To: niklas.soderlund; +Cc: linux-renesas-soc, linux-media, Kieran Bingham

From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

The rvin_digital_notify_bound() call dereferences the subdev->dev
pointer to obtain the of_node. On some error paths, this dev node can be
set as NULL. The of_node is mapped into the subdevice structure on
initialisation, so this is a safer source to compare the nodes.

Dereference the of_node from the subdev structure instead of the dev
structure.

Fixes: 83fba2c06f19 ("rcar-vin: rework how subdevice is found and
	bound")
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
 drivers/media/platform/rcar-vin/rcar-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
index 5861ab281150..a530dc388b95 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -469,7 +469,7 @@ static int rvin_digital_notify_bound(struct v4l2_async_notifier *notifier,
 
 	v4l2_set_subdev_hostdata(subdev, vin);
 
-	if (vin->digital.asd.match.of.node == subdev->dev->of_node) {
+	if (vin->digital.asd.match.of.node == subdev->of_node) {
 		/* Find surce and sink pad of remote subdevice */
 
 		ret = rvin_find_pad(subdev, MEDIA_PAD_FL_SOURCE);
-- 
2.7.4

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

end of thread, other threads:[~2017-04-27 22:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25 14:55 [PATCH] rcar-vin: Use of_nodes as specified by the subdev Kieran Bingham
2017-04-26  7:23 ` Simon Horman
2017-04-26  7:48   ` Kieran Bingham
2017-04-26  8:11     ` Simon Horman
2017-04-26  9:00   ` Niklas Söderlund
2017-04-26  9:13     ` Simon Horman
2017-04-27 22:49 ` Niklas Söderlund

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