diff options
Diffstat (limited to 'drivers/gpu/drm/drm_edid_load.c')
-rw-r--r-- | drivers/gpu/drm/drm_edid_load.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c index 66d4a28ad5a2..0303935d10e2 100644 --- a/drivers/gpu/drm/drm_edid_load.c +++ b/drivers/gpu/drm/drm_edid_load.c | |||
@@ -119,7 +119,7 @@ static int edid_load(struct drm_connector *connector, char *name, | |||
119 | { | 119 | { |
120 | const struct firmware *fw; | 120 | const struct firmware *fw; |
121 | struct platform_device *pdev; | 121 | struct platform_device *pdev; |
122 | u8 *fwdata = NULL, *edid; | 122 | u8 *fwdata = NULL, *edid, *new_edid; |
123 | int fwsize, expected; | 123 | int fwsize, expected; |
124 | int builtin = 0, err = 0; | 124 | int builtin = 0, err = 0; |
125 | int i, valid_extensions = 0; | 125 | int i, valid_extensions = 0; |
@@ -195,12 +195,14 @@ static int edid_load(struct drm_connector *connector, char *name, | |||
195 | "\"%s\" for connector \"%s\"\n", valid_extensions, | 195 | "\"%s\" for connector \"%s\"\n", valid_extensions, |
196 | edid[0x7e], name, connector_name); | 196 | edid[0x7e], name, connector_name); |
197 | edid[0x7e] = valid_extensions; | 197 | edid[0x7e] = valid_extensions; |
198 | edid = krealloc(edid, (valid_extensions + 1) * EDID_LENGTH, | 198 | new_edid = krealloc(edid, (valid_extensions + 1) * EDID_LENGTH, |
199 | GFP_KERNEL); | 199 | GFP_KERNEL); |
200 | if (edid == NULL) { | 200 | if (new_edid == NULL) { |
201 | err = -ENOMEM; | 201 | err = -ENOMEM; |
202 | kfree(edid); | ||
202 | goto relfw_out; | 203 | goto relfw_out; |
203 | } | 204 | } |
205 | edid = new_edid; | ||
204 | } | 206 | } |
205 | 207 | ||
206 | connector->display_info.raw_edid = edid; | 208 | connector->display_info.raw_edid = edid; |