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

Commit 62d70c4a authored by Lloyd Atkinson's avatar Lloyd Atkinson
Browse files

drm/msm/sde: add input sanitization to sde_hw_dspp



Add null checks at module boundaries for the sde hw dspp file.

Change-Id: If1995052353f1baf1434c4b3b8ee8927c8b25288
Signed-off-by: default avatarLloyd Atkinson <latkinso@codeaurora.org>
parent 925b2207
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@ static struct sde_dspp_cfg *_dspp_offset(enum sde_dspp dspp,
{
	int i;

	if (!m || !addr || !b)
		return ERR_PTR(-EINVAL);

	for (i = 0; i < m->dspp_count; i++) {
		if (dspp == m->dspp[i].id) {
			b->base_off = addr;
@@ -43,6 +46,9 @@ static void _setup_dspp_ops(struct sde_hw_dspp *c, unsigned long features)
{
	int i = 0, ret;

	if (!c || !c->cap || !c->cap->sblk)
		return;

	for (i = 0; i < SDE_DSPP_MAX; i++) {
		if (!test_bit(i, &features))
			continue;
@@ -119,6 +125,9 @@ struct sde_hw_dspp *sde_hw_dspp_init(enum sde_dspp idx,
	struct sde_hw_dspp *c;
	struct sde_dspp_cfg *cfg;

	if (!addr || !m)
		return ERR_PTR(-EINVAL);

	c = kzalloc(sizeof(*c), GFP_KERNEL);
	if (!c)
		return ERR_PTR(-ENOMEM);
+1 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ struct sde_hw_dspp {
 * should be called once before accessing every dspp.
 * @idx:  DSPP index for which driver object is required
 * @addr: Mapped register io address of MDP
 * @Return: pointer to structure or ERR_PTR
 */
struct sde_hw_dspp *sde_hw_dspp_init(enum sde_dspp idx,
			void __iomem *addr,