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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
This commit is contained in:
parent
7b91812048
commit
c572c8bbff
|
@ -36,10 +36,13 @@ static void query_edid(struct via_aux_drv *drv)
|
||||||
unsigned char edid[EDID_LENGTH];
|
unsigned char edid[EDID_LENGTH];
|
||||||
bool valid = false;
|
bool valid = false;
|
||||||
|
|
||||||
if (spec)
|
if (spec) {
|
||||||
fb_destroy_modedb(spec->modedb);
|
fb_destroy_modedb(spec->modedb);
|
||||||
else
|
} else {
|
||||||
spec = kmalloc(sizeof(*spec), GFP_KERNEL);
|
spec = kmalloc(sizeof(*spec), GFP_KERNEL);
|
||||||
|
if (!spec)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
spec->version = spec->revision = 0;
|
spec->version = spec->revision = 0;
|
||||||
if (via_aux_read(drv, 0x00, edid, EDID_LENGTH)) {
|
if (via_aux_read(drv, 0x00, edid, EDID_LENGTH)) {
|
||||||
|
|
Loading…
Reference in a new issue