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

Commit aaed41ec authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation



Return -ENOMEM if the allocation fails.

Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 1d083bc9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2925,6 +2925,8 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb)
			/* Speaker Allocation Data Block */
			if (dbl == 3) {
				*sadb = kmalloc(dbl, GFP_KERNEL);
				if (!*sadb)
					return -ENOMEM;
				memcpy(*sadb, &db[1], dbl);
				count = dbl;
				break;