Skip to content

Commit

Permalink
drm/apple: Fix parse_string() memory leaks
Browse files Browse the repository at this point in the history
Signed-off-by: Asahi Lina <[email protected]>
  • Loading branch information
asahilina authored and jannau committed Mar 11, 2023
1 parent d550693 commit fba0932
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/gpu/drm/apple/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ static int parse_dimension(struct dcp_parse_ctx *handle, struct dimension *dim)
else
skip(it.handle);

if (!IS_ERR_OR_NULL(key))
kfree(key);

if (ret)
return ret;
}
Expand Down Expand Up @@ -298,6 +301,9 @@ static int parse_color_modes(struct dcp_parse_ctx *handle, s64 *preferred_id)
else
skip(it.handle);

if (!IS_ERR_OR_NULL(key))
kfree(key);

if (ret)
return ret;
}
Expand Down Expand Up @@ -381,6 +387,9 @@ static int parse_mode(struct dcp_parse_ctx *handle,
else
skip(it.handle);

if (!IS_ERR_OR_NULL(key))
kfree(key);

if (ret)
return ret;
}
Expand Down Expand Up @@ -511,6 +520,9 @@ int parse_display_attributes(struct dcp_parse_ctx *handle, int *width_mm,
else
skip(it.handle);

if (!IS_ERR_OR_NULL(key))
kfree(key);

if (ret)
return ret;
}
Expand Down

0 comments on commit fba0932

Please sign in to comment.