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

Commit c572c8bb authored by Dan Carpenter's avatar Dan Carpenter Committed by Florian Tobias Schandinat
Browse files

viafb: NULL dereference on allocation failure in query_edid()



We should handle the allocation here, if only to keep the static
checkers happy.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent 7b918120
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -36,10 +36,13 @@ static void query_edid(struct via_aux_drv *drv)
	unsigned char edid[EDID_LENGTH];
	bool valid = false;

	if (spec)
	if (spec) {
		fb_destroy_modedb(spec->modedb);
	else
	} else {
		spec = kmalloc(sizeof(*spec), GFP_KERNEL);
		if (!spec)
			return;
	}

	spec->version = spec->revision = 0;
	if (via_aux_read(drv, 0x00, edid, EDID_LENGTH)) {