Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3addaba8 authored by Tobias Jordan's avatar Tobias Jordan Committed by Philipp Zabel
Browse files

gpu: ipu-v3: prg: fix device node leak in ipu_prg_lookup_by_phandle



Before returning, call of_node_put() for the device node returned by
of_parse_phandle().

Fixes: ea9c2605 ("gpu: ipu-v3: add driver for Prefetch Resolve Gasket")
Signed-off-by: default avatarTobias Jordan <Tobias.Jordan@elektrobit.com>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent c795f305
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -102,11 +102,14 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
			mutex_unlock(&ipu_prg_list_mutex);
			device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
			prg->id = ipu_id;
			of_node_put(prg_node);
			return prg;
		}
	}
	mutex_unlock(&ipu_prg_list_mutex);

	of_node_put(prg_node);

	return NULL;
}