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

Commit eb76995f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: Fix potential deferencing of null pointer"

parents e4868cd2 eb2b1aa2
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -6804,9 +6804,6 @@ static int is_valid_calib_addr(void *addr, u32 operation)
	int ret = 0;
	char __iomem *ptr = addr;
	char __iomem *mixer_base = mdss_res->mixer_intf->base;
	char __iomem *rgb_base   = mdss_res->rgb_pipes->base;
	char __iomem *dma_base   = mdss_res->dma_pipes->base;
	char __iomem *vig_base   = mdss_res->vig_pipes->base;
	char __iomem *ctl_base   = mdss_res->ctl_off->base;
	char __iomem *dspp_base  = mdss_res->mixer_intf->dspp_base;

@@ -6838,17 +6835,20 @@ static int is_valid_calib_addr(void *addr, u32 operation)
			if (ret)
				goto valid_addr;
		}
		if (ptr >= vig_base) {
		if (mdss_res->vig_pipes &&
		  ptr >= mdss_res->vig_pipes->base) {
			ret = is_valid_calib_vig_addr(ptr);
			if (ret)
				goto valid_addr;
		}
		if (ptr >= rgb_base) {
		if (mdss_res->rgb_pipes &&
		  ptr >= mdss_res->rgb_pipes->base) {
			ret = is_valid_calib_rgb_addr(ptr);
			if (ret)
				goto valid_addr;
		}
		if (ptr >= dma_base) {
		if (mdss_res->dma_pipes &&
		  ptr >= mdss_res->dma_pipes->base) {
			ret = is_valid_calib_dma_addr(ptr);
			if (ret)
				goto valid_addr;