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

Commit ff46d33b authored by Satya Rama Aditya Pinapala's avatar Satya Rama Aditya Pinapala Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dsi-staging: Allocate correct size of memory



Allocate memory for array using number of bytes rather than number of
elements to avoid out of bounds access to the array while
writing to it.

Change-Id: I5872d180b60f172201a0a0b77b55d518a4464f1f
Signed-off-by: default avatarSatya Rama Aditya Pinapala <psraditya30@codeaurora.org>
parent 84797bfc
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3209,8 +3209,8 @@ static int dsi_display_get_phandle_index(
	u32 *val = NULL;
	u32 *val = NULL;
	int rc = 0;
	int rc = 0;


	val = kzalloc(count, GFP_KERNEL);
	val = kcalloc(count, sizeof(*val), GFP_KERNEL);
	if (!val) {
	if (ZERO_OR_NULL_PTR(val)) {
		rc = -ENOMEM;
		rc = -ENOMEM;
		goto end;
		goto end;
	}
	}